This repository was archived by the owner on Dec 20, 2025. It is now read-only.
Run tests and collect coverage #454
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: Run tests and collect coverage | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - master | |
| # test only on code changes | |
| paths: | |
| - 'packages/*/src/**' | |
| schedule: | |
| - cron: "0 0 * * SUN" # Run every 00:00 on Sunday | |
| workflow_dispatch: | |
| pull_request: | |
| # test only on code changes | |
| paths: | |
| - 'packages/*/src/**' | |
| jobs: | |
| test: | |
| name: Run tests and collect coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup-environment | |
| - name: Build Package using tsup and turbo | |
| run: pnpm run build --filter=google-sr --filter=google-sr-selectors | |
| - name: Run tests | |
| run: pnpm run test --coverage --reporter=junit --outputFile=junit.xml | |
| env: | |
| RUN_LIVE_TESTS: "1" | |
| - name: Upload coverage results to Codecov | |
| # do not run on weekly schedule (only on pr and push) | |
| if: github.event_name != 'schedule' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| # Run even if tests fail | |
| # https://docs.codecov.com/docs/test-analytics | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |