Skip to content

Commit

Permalink
chore: use separate GHA job for smoke tests (#393)
Browse files Browse the repository at this point in the history
* chore: use separate GHA job for smoke tests

* chore: upgrade vitest

* chore: install deno for smoke tests job

* chore: actually run smoke tests in smoke tests job

---------

Co-authored-by: Rob Stanford <[email protected]>
  • Loading branch information
pieh and orinokai authored Apr 3, 2024
1 parent 8c8faa0 commit 035d0cc
Show file tree
Hide file tree
Showing 5 changed files with 327 additions and 823 deletions.
52 changes: 43 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
- name: Run Playwright tests
run: npm run e2e:ci -- --shard=${{ matrix.shard }}/4
run: npm run test:ci:e2e -- --shard=${{ matrix.shard }}/4
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
NEXT_VERSION: ${{ matrix.version }}
Expand Down Expand Up @@ -137,12 +137,6 @@ jobs:
run: npm ci
- name: 'Build'
run: npm run build
- name: 'Netlify Login'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
run: |
npm i -g netlify-cli
netlify login
- name: Resolve Next.js version
id: resolve-next-version
shell: bash
Expand Down Expand Up @@ -172,13 +166,53 @@ jobs:
env:
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
- name: 'Test'
run: npm run test:ci -- --shard=${{ matrix.shard }}/8
- name: 'Unit and integration tests'
run: npm run test:ci:unit-and-integration -- --shard=${{ matrix.shard }}/8
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
TEMP: ${{ github.workspace }}/..

smoke:
if: always()
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: setup pnpm/yarn
run: corepack enable
shell: bash
- name: Install Deno
uses: denoland/setup-deno@v1
with:
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/edge-bundler/blob/main/node/bridge.ts#L17
deno-version: v1.37.0
- name: 'Install dependencies'
run: npm ci
- name: 'Build'
run: npm run build
- name: 'Netlify Login'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
run: |
npm i -g netlify-cli
netlify login
- name: 'Smoke tests'
run: npm run test:ci:smoke
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}

merge-reports:
if: always()
needs: [setup,e2e]
Expand Down
Loading

0 comments on commit 035d0cc

Please sign in to comment.