test: use playwright instead of testcafe #1896
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 | |
| permissions: {} | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: '20 11 * * 1' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - run: npm run build | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - run: npm run format-check | |
| - run: git diff --quiet | |
| check-docs: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build | |
| - format | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - uses: r-lib/actions/setup-pandoc@6f6e5bc62fba3a704f74e7ad7ef7676c5c6a2590 # v2.11.4 | |
| with: | |
| pandoc-version: latest | |
| - run: npm run build | |
| - run: npm run docs-check | |
| node-versions: | |
| uses: panva/.github/.github/workflows/node-versions.yml@main | |
| with: | |
| min: 20 | |
| node: | |
| needs: | |
| - node-versions | |
| - build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: ${{ fromJSON(needs.node-versions.outputs.matrix) }} | |
| suite: | |
| - tap:node | |
| - test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| check-latest: true | |
| - run: npm clean-install | |
| - name: Run Test Suite | |
| run: npm run ${{ matrix.suite }} | |
| - name: Upload server logs | |
| if: ${{ failure() && matrix.suite == 'tap:node' }} | |
| id: artifact-upload-step | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| path: server.log | |
| name: node idx(${{ strategy.job-index }}) server log | |
| if-no-files-found: warn | |
| electron: | |
| needs: | |
| - build | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - run: npm install --global electron | |
| - name: Run Test Suite | |
| run: npm run tap:electron | |
| - name: Upload server logs | |
| if: ${{ failure() }} | |
| id: artifact-upload-step | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| path: server.log | |
| name: electron server log | |
| if-no-files-found: warn | |
| deno: | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: denoland/setup-deno@e95548e56dfa95d4e1a28d6f422fafe75c4c26fb # v2.0.3 | |
| with: | |
| deno-version: latest | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - name: Run Test Suite | |
| run: npm run tap:deno | |
| - name: Upload server logs | |
| if: ${{ failure() }} | |
| id: artifact-upload-step | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| path: server.log | |
| name: deno server log | |
| if-no-files-found: warn | |
| workerd: | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - run: npm install --global workerd | |
| - run: npm link workerd | |
| - name: Run Test Suite | |
| run: npm run tap:workerd | |
| bun: | |
| needs: | |
| - build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2 | |
| with: | |
| bun-version: latest | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - name: Run Test Suite | |
| run: npm run tap:bun | |
| - name: Upload server logs | |
| if: ${{ failure() }} | |
| id: artifact-upload-step | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| path: server.log | |
| name: bun server log | |
| if-no-files-found: warn | |
| browsers: | |
| needs: | |
| - build | |
| runs-on: macos-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| browser: | |
| - chromium | |
| - firefox | |
| - safari | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup node | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'npm' | |
| - run: npm clean-install | |
| - name: Get Playwright version | |
| id: playwright-version | |
| run: | | |
| echo "version=$(npm list playwright --json | jq -r '.dependencies["@playwright/test"].dependencies.playwright.version')" >> | |
| $GITHUB_OUTPUT | |
| - uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 | |
| with: | |
| path: ~/Library/Caches/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} | |
| - run: npx playwright install --only-shell chromium firefox webkit | |
| - name: Run Test Suite | |
| run: npm run tap:browsers | |
| env: | |
| BROWSER: ${{ matrix.browser }} | |
| - name: Upload server logs | |
| if: ${{ failure() }} | |
| id: artifact-upload-step | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| path: server.log | |
| name: ${{ matrix.browser }} server log | |
| if-no-files-found: warn |