Skip to content

Use playwright container to speed up browser install #31

Use playwright container to speed up browser install

Use playwright container to speed up browser install #31

name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
test:
timeout-minutes: 20
runs-on: ubuntu-latest
# It is recommended to use Docker image version that matches Playwright version.
# If the Playwright version in your Docker image does not match the version in your project/tests, Playwright will be unable to locate browser executables.
container:
image: mcr.microsoft.com/playwright:v1.32.3-jammy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: 'src/frontend/package-lock.json'
- uses: actions/setup-java@master
with:
distribution: adopt
java-version: 11
- uses: gradle/[email protected]
with:
arguments: release --scan -Pnpm.download=false -i
- name: Install dependencies
run: npm ci
# You don't need this if you are running playwright container
# - name: Install Playwright Browsers
# run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test 2>&1
- uses: actions/upload-artifact@v3
if: always()
with:
name: screenshots
path: tests/screenshots/
retention-days: 30
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/upload-artifact@v3
if: always()
with:
name: artifacts
path: artifacts