-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): update Playwright test workflow to support both main and m…
…aster branches, enhance caching, and extend timeout
- Loading branch information
1 parent
c4df368
commit 53ceb21
Showing
1 changed file
with
30 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
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/ |