Skip to content

Commit 3143e05

Browse files
authored
ci: add test suite selection (#5)
1 parent ebb40ce commit 3143e05

File tree

2 files changed

+61
-15
lines changed

2 files changed

+61
-15
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Ecosystem Run
2+
description: Run ecosystem CI with specific test suite
3+
inputs:
4+
version:
5+
required: true
6+
description: "@webcontainer/api version to use"
7+
test-suite:
8+
required: true
9+
description: Test suite to run
10+
11+
runs:
12+
using: composite
13+
14+
steps:
15+
- uses: actions/setup-node@v4
16+
id: setup-node
17+
continue-on-error: true
18+
with:
19+
node-version: 20
20+
21+
- run: corepack enable
22+
shell: bash
23+
24+
- run: pnpm --version
25+
shell: bash
26+
27+
- run: pnpm i --frozen-lockfile
28+
shell: bash
29+
30+
- run: >-
31+
pnpm run test
32+
--release ${{ inputs.version }}
33+
${{ inputs.test-suite }}
34+
id: ecosystem-ci-run
35+
shell: bash

.github/workflows/ecosystem-ci.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,46 @@ on:
1616
required: true
1717
type: string
1818
default: "latest"
19+
suite:
20+
description: "testsuite to run"
21+
type: choice
22+
default: "all"
23+
options:
24+
- all
25+
- starters
26+
- vitest-in-webcontainer
27+
- webcontainer-test
1928

2029
jobs:
2130
test-ecosystem:
31+
if: inputs.suite == 'all'
2232
timeout-minutes: 60
2333
runs-on: ubuntu-latest
2434
strategy:
35+
fail-fast: false
2536
matrix:
2637
suite:
2738
- starters
2839
- vitest-in-webcontainer
2940
- webcontainer-test
30-
fail-fast: false
3141
steps:
3242
- uses: actions/checkout@v4
3343

34-
- uses: actions/setup-node@v4
44+
- name: Run ${{ matrix.suite }}
45+
uses: ./.github/actions/ecosystem-run
3546
with:
36-
node-version: 20
37-
id: setup-node
38-
continue-on-error: true
39-
40-
- run: corepack enable
47+
test-suite: ${{ matrix.suite }}
48+
version: ${{ inputs.version || github.event.client_payload.version }}
4149

42-
- run: pnpm --version
43-
44-
- run: pnpm i --frozen-lockfile
50+
test-ecosystem-selected:
51+
if: inputs.suite != 'all'
52+
timeout-minutes: 60
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
4556

46-
- run: >-
47-
pnpm run test
48-
--release ${{ inputs.version || github.event.client_payload.version }}
49-
${{ matrix.suite }}
50-
id: ecosystem-ci-run
57+
- name: Run ${{ inputs.suite }}
58+
uses: ./.github/actions/ecosystem-run
59+
with:
60+
test-suite: ${{ inputs.suite }}
61+
version: ${{ inputs.version || github.event.client_payload.version }}

0 commit comments

Comments
 (0)