support for public gh app #79
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
name: Playwright Tests | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
test-docker: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
file: Dockerfile | |
load: true | |
tags: ui:test | |
test: | |
timeout-minutes: 10 | |
permissions: | |
checks: write | |
pull-requests: read | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install dependencies | |
run: npm ci | |
- name: Build the app | |
run: npm run build | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Vite tests | |
run: CI=true npm test | |
- name: Run Playwright tests | |
run: CI=true RUN_COMMAND='npm run preview' npm run test:e2e | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
test-docker-playwright: | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and export to Docker | |
uses: docker/build-push-action@v6 | |
with: | |
load: true | |
tags: app:pw | |
build-args: mode=playwright | |
- name: Run Playwright tests | |
run: | | |
docker run --rm --name playwright \ | |
-v $(pwd)/test-results-docker:/test-results \ | |
-e NUXT_SESSION_PASSWORD=foo-foo-foo-foo-foo-foo-foo-foo-foo-foo-foo-foo \ | |
app:pw | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report-docker | |
path: test-results-docker/ | |
retention-days: 30 |