Repository navigation
Add GitHub Actions CI workflow alongside CircleCI #7
This file contains hidden or 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: | |
| pull_request: | |
| push: | |
| branches: [master, prototype] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} | |
| jobs: | |
| javascript-tests: | |
| name: javascript-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-pnpm | |
| - name: Run Jest tests | |
| run: pnpm test:ci | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: javascript | |
| fail_ci_if_error: false | |
| javascript-integration-tests: | |
| name: javascript-integration-tests | |
| runs-on: ubuntu-latest | |
| env: | |
| CI: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-pnpm | |
| - name: Get Playwright version | |
| id: playwright-version | |
| run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> "$GITHUB_OUTPUT" | |
| - uses: actions/cache@v4 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-firefox-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} | |
| - name: Install Playwright Firefox | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install --with-deps firefox | |
| # The browser cache does not cover OS packages, so install those on every run. | |
| - name: Install Playwright OS dependencies | |
| if: steps.playwright-cache.outputs.cache-hit == 'true' | |
| run: npx playwright install-deps firefox | |
| - name: Run Playwright integration tests | |
| run: pnpm test:integration | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: playwright-report | |
| path: | | |
| playwright-report | |
| test-results | |
| retention-days: 14 | |
| javascript-lint: | |
| name: javascript-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-pnpm | |
| - name: Run linting | |
| run: pnpm lint | |
| - name: Check markdown linting | |
| run: pnpm markdownlint | |
| builds: | |
| name: builds | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| cache-dependency-path: | | |
| tox.ini | |
| requirements/*.txt | |
| # pre-commit's biome hook needs node; setup-node without pnpm is enough. | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: package.json | |
| - run: pip install tox | |
| - name: Build docs | |
| run: tox -e docs | |
| - name: Run linters | |
| run: tox -e linters | |
| python-tests-general: | |
| name: python-tests-general | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| cache-dependency-path: tox.ini | |
| - run: pip install tox | |
| - name: Run tests and coverage within Docker container | |
| run: tox -e docker-general | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: python | |
| fail_ci_if_error: false | |
| python-tests-perf: | |
| name: python-tests-perf | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| cache-dependency-path: tox.ini | |
| - run: pip install tox | |
| - name: Run tests and coverage within Docker container | |
| run: tox -e docker-perf | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: python | |
| fail_ci_if_error: false | |
| python-tests-frontend: | |
| name: python-tests-frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| cache-dependency-path: tox.ini | |
| - run: pip install tox | |
| - name: Run tests and coverage within Docker container | |
| run: tox -e docker-frontend | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: python | |
| fail_ci_if_error: false | |
| python-tests-telemetry: | |
| name: python-tests-telemetry | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.13' | |
| cache: pip | |
| cache-dependency-path: tox.ini | |
| - run: pip install tox | |
| - name: Run tests and coverage within Docker container | |
| run: tox -e docker-telemetry | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: python | |
| fail_ci_if_error: false | |
| test-docker-build: | |
| name: test-docker-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Create version.json | |
| run: | | |
| # https://github.com/mozilla-services/Dockerflow/blob/master/docs/version_object.md | |
| printf '{"commit":"%s","version":"%s","source":"https://github.com/%s","build":"%s"}\n' \ | |
| "$GITHUB_SHA" \ | |
| "" \ | |
| "$GITHUB_REPOSITORY" \ | |
| "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" > version.json | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| push: false | |
| tags: app:build | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |