Skip to content

Commit 85c9714

Browse files
committed
ci: run selected test suite
1 parent ab819b0 commit 85c9714

File tree

2 files changed

+57
-36
lines changed

2 files changed

+57
-36
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: 22 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -27,51 +27,37 @@ on:
2727
- webcontainer-test
2828

2929
jobs:
30-
resolve_suites:
31-
runs-on: ubuntu-latest
32-
outputs:
33-
suites: ${{ steps.set-suites.outputs.suites }}
34-
steps:
35-
- id: set-suites
36-
run: >
37-
if [[ "${{ inputs.suite }}" == "all" ]]
38-
then
39-
echo 'suites=[${{ env.options }}]' >> $GITHUB_OUTPUT
40-
else
41-
echo 'suites=["${{ inputs.suite }}"]' >> $GITHUB_OUTPUT
42-
fi
43-
env:
44-
options:
45-
- starters
46-
- vitest-in-webcontainer
47-
- webcontainer-test
48-
4930
test-ecosystem:
31+
if: inputs.suite == "all"
5032
timeout-minutes: 60
5133
runs-on: ubuntu-latest
52-
needs:
53-
- resolve_suites
5434
strategy:
55-
matrix:
56-
suite: ${{ fromJson(needs.resolve_suites.outputs.suites) }}
5735
fail-fast: false
36+
matrix:
37+
suite:
38+
- starters
39+
- vitest-in-webcontainer
40+
- webcontainer-test
5841
steps:
5942
- uses: actions/checkout@v4
6043

61-
- uses: actions/setup-node@v4
44+
- name: Run ${{ matrix.suite }}
45+
uses: ./.github/actions/ecosystem-run
6246
with:
63-
node-version: 20
64-
id: setup-node
65-
continue-on-error: true
66-
67-
- run: corepack enable
47+
test-suite: ${{ matrix.suite }}
48+
version: ${{ inputs.version || github.event.client_payload.version }}
6849

69-
- run: pnpm --version
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
7056

71-
- run: pnpm i --frozen-lockfile
57+
- run: echo "Inputs suite is '${{ inputs.suite }}'"
7258

73-
- run: >-
74-
pnpm run test
75-
--release ${{ inputs.version || github.event.client_payload.version }}
76-
${{ matrix.suite }}
77-
id: ecosystem-ci-run
59+
- name: Run ${{ inputs.suite }}
60+
uses: ./.github/actions/ecosystem-run
61+
with:
62+
test-suite: ${{ inputs.suite }}
63+
version: ${{ inputs.version || github.event.client_payload.version }}

0 commit comments

Comments
 (0)