Bump playwright from 1.39.0-jammy to v1.40.0-jammy #7923
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
jobs: | |
build-assets: | |
name: 'Build assets' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Set up Node.js' | |
uses: actions/[email protected] | |
with: | |
node-version-file: package.json | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Set up assets cache' | |
uses: actions/[email protected] | |
if: ${{ !env.ACT }} | |
with: | |
path: .webpack | |
key: webpack-${{ github.head_ref || github.ref_name }} | |
restore-keys: webpack- | |
- name: 'Build assets' | |
run: npm run build:assets | |
- name: 'Upload assets' | |
uses: actions/[email protected] | |
with: | |
name: assets | |
path: dist/assets | |
- name: 'Upload manifest' | |
uses: actions/[email protected] | |
with: | |
name: manifest | |
path: src/manifest.json | |
build-image: | |
name: 'Build image' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
outputs: | |
image: ${{ steps.build.outputs.imageid }} | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Set up Docker Build' | |
uses: docker/[email protected] | |
- name: 'Build image' | |
id: build | |
uses: docker/[email protected] | |
with: | |
outputs: type=docker,dest=/tmp/image.tar | |
cache-from: type=gha,ignore-error=true | |
cache-to: type=gha,mode=max,ignore-error=true | |
- name: 'Upload build' | |
uses: actions/[email protected] | |
with: | |
name: image | |
path: /tmp/image.tar | |
format: | |
name: 'Format' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Set up Node.js' | |
uses: actions/[email protected] | |
with: | |
node-version-file: package.json | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Run formatter' | |
run: npm run format | |
lint: | |
name: 'Lint' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: | |
- build-assets | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Set up Node.js' | |
uses: actions/[email protected] | |
with: | |
node-version-file: package.json | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Download assets manifest' | |
uses: actions/[email protected] | |
with: | |
name: manifest | |
path: src | |
- name: 'Run the linters' | |
run: npm run lint | |
test: | |
name: 'Test (${{ matrix.shard }}/${{ strategy.job-total }})' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: | |
- build-assets | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: [1, 2] | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Set up Node.js' | |
uses: actions/[email protected] | |
with: | |
node-version-file: package.json | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Download assets manifest' | |
uses: actions/[email protected] | |
with: | |
name: manifest | |
path: src | |
- name: 'Run the tests' | |
run: npm run test -- --shard=${{ matrix.shard }}/${{ strategy.job-total }} | |
test-integration: | |
name: 'Integration test (${{ matrix.shard }}/${{ strategy.job-total }})' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: | |
- build-assets | |
strategy: | |
fail-fast: false | |
matrix: | |
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] | |
steps: | |
- name: 'Checkout code' | |
uses: nschloe/[email protected] | |
- name: 'Set up Node.js' | |
uses: actions/[email protected] | |
with: | |
node-version-file: package.json | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Download assets' | |
uses: actions/[email protected] | |
with: | |
name: assets | |
path: dist/assets | |
- name: 'Download assets manifest' | |
uses: actions/[email protected] | |
with: | |
name: manifest | |
path: src | |
- name: 'Run Playwright' | |
id: 'playwright' | |
uses: docker://mcr.microsoft.com/playwright:v1.39.0-jammy | |
with: | |
args: env HOME=/root npx playwright test --forbid-only --shard=${{ matrix.shard }}/${{ strategy.job-total }} --retries 4 | |
- name: 'Store results' | |
if: failure() && steps.playwright.outcome == 'failure' | |
uses: actions/[email protected] | |
with: | |
name: integration-tests-results-${{ matrix.shard }} | |
path: integration-results | |
test-smoke: | |
name: 'Smoke test' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: | |
- build-image | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Download image' | |
uses: actions/[email protected] | |
with: | |
name: image | |
path: /tmp | |
- name: 'Load image' | |
run: docker load --input /tmp/image.tar | |
- name: 'Run smoke test' | |
run: scripts/smoke-test.sh ${{ needs.build-image.outputs.image }} | |
test-web: | |
name: 'Web Tests' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Set up Node.js' | |
uses: actions/[email protected] | |
with: | |
node-version-file: package.json | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Install browser dependencies' | |
run: npx playwright install-deps | |
- name: 'Install browsers' | |
run: npx playwright install | |
- name: 'Run the tests' | |
run: npx web-test-runner | |
typecheck: | |
name: 'Typecheck' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: | |
- build-assets | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
- name: 'Set up Node.js' | |
uses: actions/[email protected] | |
with: | |
node-version-file: package.json | |
cache: ${{ !env.ACT && 'npm' || '' }} | |
- name: 'Install dependencies' | |
run: npm ci | |
- name: 'Download assets manifest' | |
uses: actions/[email protected] | |
with: | |
name: manifest | |
path: src | |
- name: 'Run typechecker' | |
run: npm run typecheck | |
push: | |
name: 'Push image' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
if: github.ref == 'refs/heads/main' | |
outputs: | |
image: ${{ steps.image.outputs.image }} | |
needs: | |
- build-image | |
- format | |
- lint | |
- test | |
- test-integration | |
- test-smoke | |
- test-web | |
- typecheck | |
steps: | |
- name: 'Set up flyctl' | |
uses: superfly/flyctl-actions/[email protected] | |
- name: 'Log in to the registry' | |
run: flyctl auth docker | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
- name: 'Download image' | |
uses: actions/[email protected] | |
with: | |
name: image | |
path: /tmp | |
- name: 'Load image' | |
run: docker load --input /tmp/image.tar | |
- name: 'Generate image name' | |
id: image | |
run: echo "image=registry.fly.io/prereview:${{ github.sha }}" >> $GITHUB_OUTPUT | |
- name: 'Tag image' | |
run: docker tag ${{ needs.build-image.outputs.image }} ${{ steps.image.outputs.image }} | |
- name: 'Push image' | |
run: docker push ${{ steps.image.outputs.image }} | |
deploy: | |
name: 'Deploy (${{ matrix.instance }})' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
if: github.ref == 'refs/heads/main' | |
needs: | |
- push | |
strategy: | |
fail-fast: false | |
matrix: | |
instance: ['prod', 'sandbox'] | |
steps: | |
- name: 'Checkout code' | |
uses: actions/[email protected] | |
with: | |
sparse-checkout: fly.${{ matrix.instance }}.toml | |
sparse-checkout-cone-mode: false | |
- name: 'Set up flyctl' | |
uses: superfly/flyctl-actions/[email protected] | |
- name: 'Deploy app' | |
run: flyctl deploy --config fly.${{ matrix.instance }}.toml --image ${{ needs.push.outputs.image }} | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
notify: | |
name: 'Notify of failure' | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
needs: | |
- deploy | |
if: failure() && github.ref == 'refs/heads/main' | |
steps: | |
- uses: voxmedia/[email protected] | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }} | |
with: | |
channel_id: G015ZLXJA9W | |
status: FAILED | |
color: danger |