Skip to content

Commit

Permalink
chore(ci): update Playwright test workflow to support both main and m…
Browse files Browse the repository at this point in the history
…aster branches, enhance caching, and extend timeout
  • Loading branch information
MoinJulian committed Nov 22, 2024
1 parent c4df368 commit 53ceb21
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
name: Test

name: Playwright Tests
on:
push:
branches:
- main
branches: [main, master]
pull_request:
branches:
- main

branches: [main, master]
jobs:
test-logs:
timeout-minutes: 10
test:
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Cache Node Modules
id: realgolfgames-logs-cache-node-modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-${{ env.cache-name }}-
${{ runner.os }}-node-modules-
${{ runner.os }}-
node-version: '16.x'

- name: Install dependencies
if: steps.realgolfgames-logs-cache-node-modules.outputs.cache-hit != 'true'
run: npm install

- name: Install Playwright dependencies
run: npx playwright install --with-deps chromium
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- run: npm ci
- run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: npx playwright install-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Run tests
run: npx playwright test --project="Google Chrome"
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v2
if: always()
with:
name: playwright-test-results
path: test-results/

0 comments on commit 53ceb21

Please sign in to comment.