-
Notifications
You must be signed in to change notification settings - Fork 146
Update actions/upload-artifact action to v5 #2666
This file contains hidden or 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
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build the project
run: npm run build
env:
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- name: Start the application
run: npm run start &
env:
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
- name: Wait for the application to be ready
run: |
echo "Waiting for the application to be ready..."
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:3000)" != "200" ]]; do sleep 5; done' || false
echo "Application is ready!"
- name: Run Playwright tests
run: npx playwright test
env:
CI: true
NEXT_PUBLIC_GRAPHQL_URL: ${{ secrets.NEXT_PUBLIC_GRAPHQL_URL }}
DEBUG: pw:api
- name: Upload test results
if: always()
uses: actions/upload-artifact@v5
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload test traces
if: failure()
uses: actions/upload-artifact@v5
with:
name: playwright-traces
path: test-results/
retention-days: 30