Playwright alpine #14
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: | |
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: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Run Playwright tests | |
run: CI=true npm test | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
test-api-org: | |
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: api.Dockerfile | |
load: true | |
tags: api:test | |
build-args: mode=playwright | |
- name: Run Playwright tests | |
run: | | |
docker run --rm --name playwright \ | |
-v $(pwd)/test-results-docker-org:/test-results \ | |
-e CI=true \ | |
-e VUE_APP_SCOPE=organization \ | |
-e VUE_APP_GITHUB_ORG=octodemo \ | |
-e VUE_APP_GITHUB_API=/api/github \ | |
-e APP_MOCKED_DATA=true \ | |
-e VUE_APP_GITHUB_TOKEN=dummy \ | |
-e SESSION_SECRET=dummy \ | |
api:test "@org" | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report-docker-org | |
path: test-results-docker-org/ | |
retention-days: 30 | |
test-api-ent: | |
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: api.Dockerfile | |
load: true | |
tags: api:test | |
build-args: mode=playwright | |
- name: Run Playwright tests | |
run: | | |
docker run --rm --name playwright \ | |
-v $(pwd)/test-results-docker-ent:/test-results \ | |
-e CI=true \ | |
-e VUE_APP_SCOPE=enterprise \ | |
-e VUE_APP_GITHUB_ENT=octodemo \ | |
-e VUE_APP_GITHUB_API=/api/github \ | |
-e APP_MOCKED_DATA=true \ | |
-e VUE_APP_GITHUB_TOKEN=dummy \ | |
-e SESSION_SECRET=dummy \ | |
api:test "@ent" | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report-docker-ent | |
path: test-results-docker-ent/ | |
retention-days: 30 |