Skip to content

Commit

Permalink
feat: use self-hosted runner
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 18, 2024
1 parent 9eb88aa commit e451795
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 34 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,21 @@ jobs:
name: Get Runner Labels
uses: ./.github/workflows/get-runner-labels.yml

# prepare-binding:
# name: Prepare Rspack Binding
# needs: [get-runner-labels]
# runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
# steps:
# - uses: actions/checkout@v4
# - name: Init env
# uses: ./.github/actions/env
# - uses: ./.github/actions/prepare-rspack-binding
# with:
# path: ${{ env.RSPACK_DIR }}
prepare-binding:
name: Prepare Rspack Binding
needs: [get-runner-labels]
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
steps:
- uses: actions/checkout@v4
- name: Init env
uses: ./.github/actions/env
- uses: ./.github/actions/prepare-rspack-binding
with:
path: ${{ env.RSPACK_DIR }}

bench:
# needs: prepare-binding
needs: [get-runner-labels]
runs-on: [self-hosted, benchmark]
needs: [get-runner-labels, prepare-binding]
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
timeout-minutes: 30
strategy:
matrix:
Expand All @@ -48,9 +47,9 @@ jobs:
uses: actions/checkout@v4
- name: Init env
uses: ./.github/actions/env
# - uses: ./.github/actions/build-rspack
# with:
# path: ${{ env.RSPACK_DIR }}
- uses: ./.github/actions/build-rspack
with:
path: ${{ env.RSPACK_DIR }}
# - name: Run benchmark
# run: node bin/cli.js bench --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Run benchmarks
Expand Down
20 changes: 20 additions & 0 deletions 10000.bench.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { bench, describe } from "vitest";
import { rspack } from "@rspack/core";
import rspackConfig from './cases/10000/rspack.config';

describe("10000 modules project", () => {
bench("build with development mode", () => new Promise((resolve, reject) => {
rspack({
...rspackConfig,
mode: "development"
}, (err, stats) => {
if (err) {
reject(err);
}
if (stats?.hasErrors()) {
reject(new Error(stats.toString({})));
}
resolve();
});
}));
});
1 change: 1 addition & 0 deletions cases/10000/rspack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const ReactRefreshPlugin = require("@rspack/plugin-react-refresh");
const prod = process.env.NODE_ENV === "production";
/** @type {import("@rspack/cli").Configuration} */
module.exports = {
context: __dirname,
resolve: {
extensions: [".js", ".jsx"]
},
Expand Down
17 changes: 0 additions & 17 deletions fibo.bench.ts

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependencies": {
"@actions/core": "^1.10.1",
"@icon-park/react": "^1.4.2",
"@rspack/core": "^1.1.6",
"@rspack/plugin-react-refresh": "1.0.0",
"meow": "^13.2.0",
"react": "^18.2.0",
Expand Down
137 changes: 137 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e451795

Please sign in to comment.