Skip to content

Commit 7cd710d

Browse files
committed
feat: add Rslib
1 parent 3125e20 commit 7cd710d

File tree

15 files changed

+486
-10
lines changed

15 files changed

+486
-10
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Build Rslib"
2+
description: "Checkout, build rslib"
3+
inputs:
4+
repository:
5+
description: "The rslib repository to use"
6+
required: true
7+
default: "web-infra-dev/rslib"
8+
path:
9+
description: "Destination path to the rslib repository"
10+
required: true
11+
default: "workspace/rslib"
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 Rslib repo
37+
uses: actions/checkout@v5
38+
with:
39+
repository: ${{ inputs.repository }}
40+
path: ${{ inputs.path }}
41+
ref: ${{ inputs.ref }}
42+
- name: Build Rslib
43+
shell: bash
44+
run: |
45+
cd ${{ inputs.path }}
46+
pnpm i

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,39 @@ jobs:
4141
--stack rsbuild
4242
${{ matrix.suite }}
4343
44+
rslib:
45+
strategy:
46+
matrix:
47+
include:
48+
- suite: rsbuild
49+
os: ubuntu-latest
50+
- suite: rspack
51+
os: ubuntu-latest
52+
- suite: rstest
53+
os: ubuntu-latest
54+
- suite: rspress
55+
os: ubuntu-latest
56+
- suite: rsdoctor
57+
os: ubuntu-latest
58+
fail-fast: false
59+
runs-on: ${{ matrix.os }}
60+
name: rslib (${{ matrix.suite }})
61+
steps:
62+
- uses: actions/checkout@v5
63+
- uses: ./.github/actions/build-rslib
64+
- uses: moonrepo/setup-rust@v1
65+
- name: Install
66+
run: |
67+
corepack enable
68+
pnpm install --frozen-lockfile --prefer-offline
69+
- name: Expose GitHub Runtime
70+
uses: crazy-max/ghaction-github-runtime@v3
71+
- run: >-
72+
pnpm tsx ecosystem-ci.ts
73+
run-suites
74+
--stack rslib
75+
${{ matrix.suite }}
76+
4477
rstest:
4578
strategy:
4679
matrix:
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# integration tests for rslib ecosystem - run from pr comments
2+
name: rslib-ecosystem-ci-from-commit
3+
4+
env:
5+
# 7 GiB by default on GitHub, setting to 6 GiB
6+
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
7+
NODE_OPTIONS: --max-old-space-size=6144
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
commitSHA:
13+
description: "commit sha"
14+
required: true
15+
type: string
16+
repo:
17+
description: "rslib repository to use"
18+
required: true
19+
type: string
20+
default: "web-infra-dev/rslib"
21+
suite:
22+
description: "testsuite to run. runs all testsuits when `-`."
23+
required: false
24+
type: choice
25+
options:
26+
- "-"
27+
- rsbuild
28+
- rspack
29+
- rstest
30+
- rspress
31+
- rsdoctor
32+
suiteRefType:
33+
description: "type of suite ref to use"
34+
required: true
35+
type: choice
36+
options:
37+
- precoded
38+
- branch
39+
- tag
40+
- commit
41+
default: "precoded"
42+
suiteRef:
43+
description: "suite ref to use"
44+
required: true
45+
type: string
46+
default: "precoded"
47+
updateComment:
48+
description: "update comment"
49+
required: false
50+
type: boolean
51+
default: false
52+
53+
jobs:
54+
execute-selected-suite:
55+
runs-on: ubuntu-latest
56+
if: "inputs.suite != '-'"
57+
steps:
58+
- uses: actions/checkout@v5
59+
- uses: ./.github/actions/build-rslib
60+
with:
61+
repository: ${{ inputs.repo }}
62+
ref: ${{ inputs.commitSHA }}
63+
- run: pnpm i --frozen-lockfile
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 rslib
70+
--suite-${{ inputs.suiteRefType }} ${{ inputs.suiteRef }}
71+
${{ inputs.suite }}
72+
73+
execute-all:
74+
if: "inputs.suite == '-'"
75+
strategy:
76+
matrix:
77+
include:
78+
- suite: rsbuild
79+
os: ubuntu-latest
80+
- suite: rspack
81+
os: ubuntu-latest
82+
- suite: rstest
83+
os: ubuntu-latest
84+
- suite: rspress
85+
os: ubuntu-latest
86+
- suite: rsdoctor
87+
os: ubuntu-latest
88+
fail-fast: false
89+
runs-on: ${{ matrix.os }}
90+
name: execute-all (${{ matrix.suite }})
91+
steps:
92+
- uses: actions/checkout@v5
93+
- uses: moonrepo/setup-rust@v1
94+
- uses: ./.github/actions/build-rslib
95+
with:
96+
repository: ${{ inputs.repo }}
97+
ref: ${{ inputs.commitSHA }}
98+
- run: pnpm i --frozen-lockfile
99+
- name: Expose GitHub Runtime
100+
uses: crazy-max/ghaction-github-runtime@v3
101+
- run: >-
102+
pnpm tsx ecosystem-ci.ts
103+
run-suites
104+
--stack rslib
105+
${{ matrix.suite }}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# integration tests for rslib ecosystem - run from pr comments
2+
name: rslib-ecosystem-ci-from-pr
3+
4+
env:
5+
# 7 GiB by default on GitHub, setting to 6 GiB
6+
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
7+
NODE_OPTIONS: --max-old-space-size=6144
8+
9+
on:
10+
workflow_dispatch:
11+
inputs:
12+
prNumber:
13+
description: "PR number (e.g. 9887)"
14+
required: true
15+
type: string
16+
branchName:
17+
description: "rslib branch to use"
18+
required: true
19+
type: string
20+
default: "main"
21+
repo:
22+
description: "rslib repository to use"
23+
required: true
24+
type: string
25+
default: "web-infra-dev/rslib"
26+
suite:
27+
description: "testsuite to run. runs all testsuits when `-`."
28+
required: false
29+
type: choice
30+
options:
31+
- "-"
32+
- rsbuild
33+
- rspack
34+
- rstest
35+
- rspress
36+
- rsdoctor
37+
suiteRefType:
38+
description: "type of suite ref to use"
39+
required: true
40+
type: choice
41+
options:
42+
- precoded
43+
- branch
44+
- tag
45+
- commit
46+
default: "precoded"
47+
suiteRef:
48+
description: "suite ref to use"
49+
required: true
50+
type: string
51+
default: "precoded"
52+
53+
jobs:
54+
execute-selected-suite:
55+
runs-on: ubuntu-latest
56+
if: "inputs.suite != '-'"
57+
steps:
58+
- uses: actions/checkout@v5
59+
- uses: ./.github/actions/build-rslib
60+
with:
61+
repository: ${{ inputs.repo }}
62+
ref: ${{ inputs.branchName }}
63+
- run: pnpm i --frozen-lockfile
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 rslib
70+
--suite-${{ inputs.suiteRefType }} ${{ inputs.suiteRef }}
71+
${{ inputs.suite }}
72+
73+
execute-all:
74+
if: "inputs.suite == '-'"
75+
strategy:
76+
matrix:
77+
include:
78+
- suite: rsbuild
79+
os: ubuntu-latest
80+
- suite: rspack
81+
os: ubuntu-latest
82+
- suite: rstest
83+
os: ubuntu-latest
84+
- suite: rspress
85+
os: ubuntu-latest
86+
- suite: rsdoctor
87+
os: ubuntu-latest
88+
fail-fast: false
89+
runs-on: ${{ matrix.os }}
90+
name: execute-all (${{ matrix.suite }})
91+
steps:
92+
- uses: actions/checkout@v5
93+
- uses: ./.github/actions/build-rslib
94+
with:
95+
repository: ${{ inputs.repo }}
96+
ref: ${{ inputs.branchName }}
97+
- run: pnpm i --frozen-lockfile
98+
- name: Expose GitHub Runtime
99+
uses: crazy-max/ghaction-github-runtime@v3
100+
- run: >-
101+
pnpm tsx ecosystem-ci.ts
102+
run-suites
103+
--stack rslib
104+
${{ matrix.suite }}

0 commit comments

Comments
 (0)