diff --git a/.github/actions/ecosystem-run/action.yml b/.github/actions/ecosystem-run/action.yml new file mode 100644 index 0000000..9139f28 --- /dev/null +++ b/.github/actions/ecosystem-run/action.yml @@ -0,0 +1,35 @@ +name: Ecosystem Run +description: Run ecosystem CI with specific test suite +inputs: + version: + required: true + description: "@webcontainer/api version to use" + test-suite: + required: true + description: Test suite to run + +runs: + using: composite + + steps: + - uses: actions/setup-node@v4 + id: setup-node + continue-on-error: true + with: + node-version: 20 + + - run: corepack enable + shell: bash + + - run: pnpm --version + shell: bash + + - run: pnpm i --frozen-lockfile + shell: bash + + - run: >- + pnpm run test + --release ${{ inputs.version }} + ${{ inputs.test-suite }} + id: ecosystem-ci-run + shell: bash diff --git a/.github/workflows/ecosystem-ci.yml b/.github/workflows/ecosystem-ci.yml index e8eceb1..8b4ab4f 100644 --- a/.github/workflows/ecosystem-ci.yml +++ b/.github/workflows/ecosystem-ci.yml @@ -16,35 +16,46 @@ on: required: true type: string default: "latest" + suite: + description: "testsuite to run" + type: choice + default: "all" + options: + - all + - starters + - vitest-in-webcontainer + - webcontainer-test jobs: test-ecosystem: + if: inputs.suite == 'all' timeout-minutes: 60 runs-on: ubuntu-latest strategy: + fail-fast: false matrix: suite: - starters - vitest-in-webcontainer - webcontainer-test - fail-fast: false steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Run ${{ matrix.suite }} + uses: ./.github/actions/ecosystem-run with: - node-version: 20 - id: setup-node - continue-on-error: true - - - run: corepack enable + test-suite: ${{ matrix.suite }} + version: ${{ inputs.version || github.event.client_payload.version }} - - run: pnpm --version - - - run: pnpm i --frozen-lockfile + test-ecosystem-selected: + if: inputs.suite != 'all' + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 - - run: >- - pnpm run test - --release ${{ inputs.version || github.event.client_payload.version }} - ${{ matrix.suite }} - id: ecosystem-ci-run + - name: Run ${{ inputs.suite }} + uses: ./.github/actions/ecosystem-run + with: + test-suite: ${{ inputs.suite }} + version: ${{ inputs.version || github.event.client_payload.version }}