From d31fa7a6cd7906a5ef8518779586c6ccc554bbea Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 29 Apr 2025 10:01:07 +0300 Subject: [PATCH] chore(nx/e2e): use generated playwright workflow --- .github/workflows/playwright.yml | 62 ++++++++++++++++++++------------ nx.json | 3 +- 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 7f313de99..694360363 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,28 +1,46 @@ -name: Playwright Tests +name: playwright + on: push: - branches: [ develop ] + branches: + - master pull_request: - branches: [ develop ] + +permissions: + actions: read + contents: read + jobs: - test: - timeout-minutes: 60 + main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v4 - - uses: actions/setup-node@v4 - with: - node-version: lts/* - - name: Install dependencies - run: pnpm install --frozen-lockfile - - name: Install Playwright Browsers - run: npx playwright install --with-deps - - name: Run Playwright tests - run: npx playwright test - - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: playwright-report - path: playwright-report/ - retention-days: 30 + - uses: actions/checkout@v4 + with: + filter: tree:0 + fetch-depth: 0 + + + + + # This enables task distribution via Nx Cloud + # Run this command as early as possible, before dependencies are installed + # Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun + # Connect your workspace by running "nx connect" and uncomment this line to enable task distribution + # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" + + + # Cache node_modules + - 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 diff --git a/nx.json b/nx.json index 7baa49b6c..91ff978b6 100644 --- a/nx.json +++ b/nx.json @@ -15,7 +15,8 @@ "!{projectRoot}/src/test-setup.[jt]s" ], "sharedGlobals": [ - "{workspaceRoot}/.github/workflows/release.yml" + "{workspaceRoot}/.github/workflows/release.yml", + "{workspaceRoot}/.github/workflows/playwright.yml" ] }, "plugins": [