chore(nx/e2e): use generated playwright workflow

This commit is contained in:
Elian Doran 2025-04-29 10:01:07 +03:00
parent e0002078b7
commit d31fa7a6cd
No known key found for this signature in database
2 changed files with 42 additions and 23 deletions

View File

@ -1,28 +1,46 @@
name: Playwright Tests name: playwright
on: on:
push: push:
branches: [ develop ] branches:
- master
pull_request: pull_request:
branches: [ develop ]
permissions:
actions: read
contents: read
jobs: jobs:
test: main:
timeout-minutes: 60
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: pnpm/action-setup@v4 with:
- uses: actions/setup-node@v4 filter: tree:0
with: fetch-depth: 0
node-version: lts/*
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: npx playwright install --with-deps # This enables task distribution via Nx Cloud
- name: Run Playwright tests # Run this command as early as possible, before dependencies are installed
run: npx playwright test # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
- uses: actions/upload-artifact@v4 # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution
if: ${{ !cancelled() }} # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
with:
name: playwright-report
path: playwright-report/ # Cache node_modules
retention-days: 30 - uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci --legacy-peer-deps
- run: npx playwright install --with-deps
- uses: nrwl/nx-set-shas@v4
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: npx nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
# When you enable task distribution, run the e2e-ci task instead of e2e
- run: npx nx affected -t lint test build e2e

View File

@ -15,7 +15,8 @@
"!{projectRoot}/src/test-setup.[jt]s" "!{projectRoot}/src/test-setup.[jt]s"
], ],
"sharedGlobals": [ "sharedGlobals": [
"{workspaceRoot}/.github/workflows/release.yml" "{workspaceRoot}/.github/workflows/release.yml",
"{workspaceRoot}/.github/workflows/playwright.yml"
] ]
}, },
"plugins": [ "plugins": [