test #107
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: test | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Runs nightly at 00:00 UTC | |
| - cron: '0 0 * * *' | |
| push: | |
| branches: ['**'] | |
| paths: | |
| - '.github/workflows/test.yml' | |
| - 'src/**' | |
| - 'test/**' | |
| - 'package*.json' | |
| - 'tsconfig*.json' | |
| - '.npmrc' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| # no way to avoid repeating the paths here | |
| - '.github/workflows/test.yml' | |
| - 'src/**' | |
| - 'test/**' | |
| - 'package*.json' | |
| - 'tsconfig*.json' | |
| - '.npmrc' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| MIN_PW_VERSION: '1.45' | |
| jobs: | |
| pw-versions: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| versions: ${{ steps.get-versions.outputs.versions }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - id: get-versions | |
| # By schedule run only 'beta' (if beta is actually above the latest). | |
| run: | | |
| if [[ "${{ github.event_name }}" == "schedule" ]]; then | |
| versions=$(node scripts/pw-versions.ts beta) | |
| else | |
| versions=$(node scripts/pw-versions.ts $MIN_PW_VERSION) | |
| fi | |
| echo "versions=$versions" >> $GITHUB_OUTPUT | |
| test: | |
| runs-on: ubuntu-24.04 | |
| needs: pw-versions | |
| if: needs.pw-versions.outputs.versions != '[]' | |
| timeout-minutes: 5 | |
| strategy: | |
| matrix: | |
| playwright-version: ${{ fromJson(needs.pw-versions.outputs.versions) }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set Node version | |
| id: node-version | |
| # Playwright <= 1.52 hangs on Node 24 due to require(esm). | |
| # Use Node 22 for those versions. | |
| run: | | |
| if [[ "${{ matrix.playwright-version }}" =~ ^1\.(4|5[012]) ]]; then | |
| echo "version=22" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=24" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: ${{ steps.node-version.outputs.version }} | |
| cache: 'npm' | |
| - run: npm ci | |
| - run: npm install --no-save --min-release-age=0 @playwright/test@${{ matrix.playwright-version }} | |
| - run: npx playwright install --with-deps chromium | |
| - run: | | |
| npm run test:timings | |
| npm run test:merge | |
| # Run these tests only on the latest pw | |
| - if: matrix.playwright-version == '1.59' || matrix.playwright-version == 'beta' | |
| run: | | |
| npm run test:lanes | |
| npm run test:e2e |