Skip to content

Commit 3125e20

Browse files
committed
merge workflows
1 parent 0de7a40 commit 3125e20

14 files changed

+1066
-2
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: 'Build Rspack'
2+
description: 'Checkout, download rspack binding, and build rspack js'
3+
inputs:
4+
repository:
5+
description: 'The rspack repository to use'
6+
required: true
7+
default: 'web-infra-dev/rspack'
8+
path:
9+
description: 'Destination path to the rspack repository'
10+
required: true
11+
default: 'workspace/rspack'
12+
ref:
13+
description: 'The branch, tag or SHA to checkout'
14+
required: true
15+
default: 'main'
16+
node-version:
17+
description: 'The version of Node.js to set up'
18+
required: true
19+
default: '18'
20+
outputs:
21+
artifact-name:
22+
description: 'The name of the uploaded artifact'
23+
runs:
24+
using: composite
25+
steps:
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: 20
29+
- shell: bash
30+
name: Install package manager
31+
run: |
32+
npm install -g corepack@0.24.1
33+
echo "Corepack version: $(corepack --version)"
34+
corepack enable
35+
36+
- name: Checkout Rspack repo
37+
uses: actions/checkout@v4
38+
with:
39+
repository: ${{ inputs.repository }}
40+
path: ${{ inputs.path }}
41+
ref: ${{ inputs.ref }}
42+
- uses: actions/download-artifact@v4
43+
with:
44+
name: binding-linux-x64-gnu
45+
path: ${{ inputs.path }}/npm/linux-x64-gnu
46+
- name: Show restored binding
47+
shell: bash
48+
run: ls -lah ${{ inputs.path }}/npm/linux-x64-gnu/*.node
49+
- name: Build Rspack JS
50+
shell: bash
51+
run: |
52+
cd ${{ inputs.path }}
53+
pnpm i
54+
pnpm run build:js
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: 'Build Rstest'
2+
description: 'Checkout, build rstest'
3+
inputs:
4+
repository:
5+
description: 'The rstest repository to use'
6+
required: true
7+
default: 'web-infra-dev/rstest'
8+
path:
9+
description: 'Destination path to the rstest repository'
10+
required: true
11+
default: 'workspace/rstest'
12+
ref:
13+
description: 'The branch, tag or SHA to checkout'
14+
required: true
15+
default: 'main'
16+
node-version:
17+
description: 'The version of Node.js to set up'
18+
required: true
19+
default: '22'
20+
outputs:
21+
artifact-name:
22+
description: 'The name of the uploaded artifact'
23+
runs:
24+
using: composite
25+
steps:
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 22
29+
- shell: bash
30+
name: Install package manager
31+
run: |
32+
npm install -g corepack@latest --force
33+
echo "Corepack version: $(corepack --version)"
34+
corepack enable
35+
36+
- name: Checkout Rstest repo
37+
uses: actions/checkout@v4
38+
with:
39+
repository: ${{ inputs.repository }}
40+
path: ${{ inputs.path }}
41+
ref: ${{ inputs.ref }}
42+
- name: Build Rstest
43+
shell: bash
44+
run: |
45+
cd ${{ inputs.path }}
46+
pnpm i
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: 'Prepare Rspack Binding'
2+
description: 'Checkout, build, and upload rspack native bindings'
3+
inputs:
4+
repository:
5+
description: 'The rspack repository to use'
6+
required: true
7+
default: 'web-infra-dev/rspack'
8+
path:
9+
description: 'Destination path to clone'
10+
required: true
11+
default: 'workspace/rspack'
12+
ref:
13+
description: 'The branch, tag or SHA to checkout'
14+
required: true
15+
default: 'main'
16+
node-version:
17+
description: 'The version of Node.js to set up'
18+
required: true
19+
default: '18'
20+
outputs:
21+
artifact-name:
22+
description: 'The name of the uploaded artifact'
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Checkout Rspack repo
27+
uses: actions/checkout@v4
28+
with:
29+
repository: ${{ inputs.repository }}
30+
path: ${{ inputs.path }}
31+
ref: ${{ inputs.ref }}
32+
- uses: actions/setup-node@v3
33+
with:
34+
node-version: ${{ inputs.node-version }}
35+
- shell: bash
36+
name: Install package manager
37+
run: |
38+
cd ${{ inputs.path }}
39+
npm install -g corepack@0.24.1
40+
echo "Corepack version: $(corepack --version)"
41+
corepack enable
42+
- id: rust-cache
43+
uses: MasterworksIO/action-local-cache@2
44+
with:
45+
path: '${{ inputs.path }}/target'
46+
- name: Show Rust Cache
47+
if: steps.rust-cache.outputs.cache-hit == 'true'
48+
shell: bash
49+
run: ls -lah ${{ inputs.path }}/target
50+
- name: Build Rspack
51+
shell: bash
52+
run: |
53+
cd ${{ inputs.path }}
54+
pnpm i --frozen-lockfile
55+
cargo codegen
56+
pnpm run build:binding:release
57+
- uses: actions/upload-artifact@v4
58+
with:
59+
name: binding-linux-x64-gnu
60+
path: ${{ inputs.path }}/crates/node_binding/*.node

.github/workflows/ci.yml

Lines changed: 106 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010

1111
jobs:
12-
ci:
12+
rsbuild:
1313
strategy:
1414
matrix:
1515
include:
@@ -27,7 +27,7 @@ jobs:
2727
os: ubuntu-latest
2828
fail-fast: false
2929
runs-on: ${{ matrix.os }}
30-
name: ${{ matrix.suite }}
30+
name: rsbuild (${{ matrix.suite }})
3131
steps:
3232
- uses: actions/checkout@v5
3333
- uses: ./.github/actions/build-rsbuild
@@ -38,4 +38,108 @@ jobs:
3838
- run: >-
3939
pnpm tsx ecosystem-ci.ts
4040
run-suites
41+
--stack rsbuild
42+
${{ matrix.suite }}
43+
44+
rstest:
45+
strategy:
46+
matrix:
47+
include:
48+
- suite: rslib
49+
os: ubuntu-latest
50+
- suite: rsbuild
51+
os: ubuntu-latest
52+
- suite: rsdoctor
53+
os: ubuntu-latest
54+
fail-fast: false
55+
runs-on: ${{ matrix.os }}
56+
name: rstest (${{ matrix.suite }})
57+
steps:
58+
- uses: actions/checkout@v5
59+
- uses: ./.github/actions/build-rstest
60+
- name: Install
61+
run: |
62+
corepack enable
63+
pnpm install --frozen-lockfile --prefer-offline
64+
- name: Expose GitHub Runtime
65+
uses: crazy-max/ghaction-github-runtime@v3
66+
- run: >-
67+
pnpm tsx ecosystem-ci.ts
68+
run-suites
69+
--stack rstest
70+
${{ matrix.suite }}
71+
72+
get-runner-labels:
73+
name: Get Runner Labels
74+
uses: ./.github/workflows/get-runner-labels.yml
75+
76+
prepare-rspack-binding:
77+
name: Prepare Rspack Binding
78+
needs: get-runner-labels
79+
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
80+
steps:
81+
- uses: actions/checkout@v4
82+
- uses: ./.github/actions/prepare-rspack-binding
83+
84+
rspack:
85+
needs:
86+
- get-runner-labels
87+
- prepare-rspack-binding
88+
strategy:
89+
matrix:
90+
include:
91+
- suite: modernjs
92+
os: ubuntu-22.04
93+
- suite: _selftest
94+
os: ubuntu-22.04
95+
# - suite: nx
96+
# os: ubuntu-22.04
97+
- suite: rspress
98+
os: ubuntu-22.04
99+
- suite: rsbuild
100+
os: ubuntu-22.04
101+
- suite: examples
102+
os: ubuntu-22.04
103+
- suite: rslib
104+
os: ubuntu-22.04
105+
- suite: rstest
106+
os: ubuntu-22.04
107+
- suite: rsdoctor
108+
os: ubuntu-22.04
109+
- suite: devserver
110+
os: ubuntu-22.04
111+
- suite: nuxt
112+
os: ubuntu-22.04
113+
- suite: plugin
114+
os: ubuntu-22.04
115+
- suite: lynx-stack
116+
os: ubuntu-22.04
117+
fail-fast: false
118+
runs-on: ${{ matrix.os }}
119+
name: rspack (${{ matrix.suite }})
120+
steps:
121+
- uses: actions/checkout@v4
122+
- uses: ./.github/actions/build-rspack
123+
- name: Install
124+
run: pnpm install --frozen-lockfile --prefer-offline
125+
- name: Format
126+
if: matrix.suite == '_selftest'
127+
run: pnpm format
128+
- name: Lint
129+
if: matrix.suite == '_selftest'
130+
run: pnpm lint
131+
- name: Setup Node.js
132+
if: matrix.suite == 'lynx-stack' || matrix.suite == '_selftest'
133+
uses: actions/setup-node@v4
134+
with:
135+
node-version: 22
136+
- name: Setup Rust
137+
if: matrix.suite == 'lynx-stack'
138+
uses: actions-rust-lang/setup-rust-toolchain@v1
139+
- name: Expose GitHub Runtime
140+
uses: crazy-max/ghaction-github-runtime@v3
141+
- run: >-
142+
pnpm tsx ecosystem-ci.ts
143+
run-suites
144+
--stack rspack
41145
${{ matrix.suite }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Get Runner Labels
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
LINUX_RUNNER_LABELS:
7+
description: "linux runner labels"
8+
value: ${{ jobs.main.outputs.LINUX_RUNNER_LABELS }}
9+
MACOS_RUNNER_LABELS:
10+
description: "macos runner labels"
11+
value: ${{ jobs.main.outputs.MACOS_RUNNER_LABELS }}
12+
WINDOWS_RUNNER_LABELS:
13+
description: "windows runner labels"
14+
value: ${{ jobs.main.outputs.WINDOWS_RUNNER_LABELS }}
15+
16+
jobs:
17+
main:
18+
name: Get Runner Labels
19+
runs-on: ubuntu-22.04
20+
outputs:
21+
LINUX_RUNNER_LABELS: ${{ steps.run.outputs.LINUX_RUNNER_LABELS }}
22+
MACOS_RUNNER_LABELS: ${{ steps.run.outputs.MACOS_RUNNER_LABELS }}
23+
WINDOWS_RUNNER_LABELS: ${{ steps.run.outputs.WINDOWS_RUNNER_LABELS }}
24+
steps:
25+
- id: run
26+
shell: bash
27+
run: |
28+
# set default value for vars.XXX_RUNNER_LABELS
29+
echo 'LINUX_RUNNER_LABELS=${{ vars.LINUX_RUNNER_LABELS || '"ubuntu-22.04"' }}' >> "$GITHUB_OUTPUT"
30+
echo 'MACOS_RUNNER_LABELS=${{ vars.MACOS_RUNNER_LABELS || '"macos-latest"' }}' >> "$GITHUB_OUTPUT"
31+
echo 'WINDOWS_RUNNER_LABELS=${{ vars.WINDOWS_RUNNER_LABELS || '"windows-latest"' }}' >> "$GITHUB_OUTPUT"

.github/workflows/ecosystem-ci-from-commit.yml renamed to .github/workflows/rsbuild-ecosystem-ci-from-commit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
- run: >-
6767
pnpm tsx ecosystem-ci.ts
6868
run-suites
69+
--stack rsbuild
6970
--suite-${{ inputs.suiteRefType }} ${{ inputs.suiteRef }}
7071
${{ inputs.suite }}
7172
@@ -102,4 +103,5 @@ jobs:
102103
- run: >-
103104
pnpm tsx ecosystem-ci.ts
104105
run-suites
106+
--stack rsbuild
105107
${{ matrix.suite }}

.github/workflows/ecosystem-ci-from-pr.yml renamed to .github/workflows/rsbuild-ecosystem-ci-from-pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
- run: >-
6767
pnpm tsx ecosystem-ci.ts
6868
run-suites
69+
--stack rsbuild
6970
--suite-${{ inputs.suiteRefType }} ${{ inputs.suiteRef }}
7071
${{ inputs.suite }}
7172
@@ -101,4 +102,5 @@ jobs:
101102
- run: >-
102103
pnpm tsx ecosystem-ci.ts
103104
run-suites
105+
--stack rsbuild
104106
${{ matrix.suite }}

.github/workflows/ecosystem-ci-selected.yml renamed to .github/workflows/rsbuild-ecosystem-ci-selected.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
- run: >-
7474
pnpm tsx ecosystem-ci.ts
7575
run-suites
76+
--stack rsbuild
7677
--suite-${{ inputs.suiteRefType }} ${{ inputs.suiteRef }}
7778
${{ inputs.suite }}
7879
@@ -108,4 +109,5 @@ jobs:
108109
- run: >-
109110
pnpm tsx ecosystem-ci.ts
110111
run-suites
112+
--stack rsbuild
111113
${{ matrix.suite }}

0 commit comments

Comments
 (0)