|
4 | 4 | # REVIEWERS, please always double-check security practices before merging a PR that contains Workflow changes!!
|
5 | 5 | # AUTHORS, please only use actions with explicit SHA references, and avoid using `@master` or `@main` references or `@version` tags.
|
6 | 6 |
|
7 |
| -name: Cloudflare OpenNext Build |
| 7 | +name: Playwright Tests on Cloudflare Open-Next |
8 | 8 |
|
9 | 9 | on:
|
10 | 10 | push:
|
|
14 | 14 | branches:
|
15 | 15 | - main
|
16 | 16 |
|
17 |
| -defaults: |
18 |
| - run: |
19 |
| - # This ensures that the working directory is the root of the repository |
20 |
| - working-directory: ./ |
| 17 | +concurrency: |
| 18 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 19 | + cancel-in-progress: true |
21 | 20 |
|
22 | 21 | permissions:
|
23 | 22 | contents: read
|
24 | 23 | actions: read
|
25 | 24 |
|
26 |
| -env: |
27 |
| - # See https://turbo.build/repo/docs/reference/command-line-reference/run#--cache-dir |
28 |
| - TURBO_ARGS: --cache-dir=.turbo/cache |
29 |
| - # See https://turbo.build/repo/docs/reference/command-line-reference/run#--force |
30 |
| - TURBO_FORCE: true |
31 |
| - |
32 | 25 | jobs:
|
33 |
| - build-cloudflare-worker: |
34 |
| - name: Build Cloudflare Worker |
| 26 | + playwright: |
| 27 | + name: Playwright Tests |
35 | 28 | runs-on: ubuntu-latest
|
36 | 29 |
|
37 | 30 | steps:
|
|
58 | 51 | - name: Install packages
|
59 | 52 | run: pnpm install --frozen-lockfile
|
60 | 53 |
|
61 |
| - - name: Build Cloudflare Worker |
62 |
| - run: pnpm exec turbo run cloudflare:build:worker ${{ env.TURBO_ARGS }} |
| 54 | + - name: Get Playwright version |
| 55 | + id: playwright-version |
| 56 | + working-directory: apps/site |
| 57 | + run: echo "version=$(pnpm exec playwright --version | awk '{print $2}')" >> $GITHUB_OUTPUT |
| 58 | + |
| 59 | + - name: Cache Playwright browsers |
| 60 | + id: playwright-cache |
| 61 | + uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 |
| 62 | + with: |
| 63 | + path: ~/.cache/ms-playwright |
| 64 | + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} |
| 65 | + |
| 66 | + - name: Install Playwright Browsers |
| 67 | + working-directory: apps/site |
| 68 | + run: pnpm exec playwright install --with-deps |
| 69 | + |
| 70 | + - name: Run Playwright tests |
| 71 | + working-directory: apps/site |
| 72 | + run: pnpm playwright |
| 73 | + env: |
| 74 | + PLAYWRIGHT_RUN_CLOUDFLARE_PREVIEW: true |
| 75 | + PLAYWRIGHT_BASE_URL: http://127.0.0.1:8787 |
| 76 | + |
| 77 | + - name: Upload Playwright test results |
| 78 | + if: always() |
| 79 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 80 | + with: |
| 81 | + name: playwright-report |
| 82 | + path: apps/site/playwright-report/ |
0 commit comments