-
Notifications
You must be signed in to change notification settings - Fork 70
90 lines (79 loc) · 2.62 KB
/
run-playwright-on-pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Playwright tests on pr
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
paths:
- 'frontend/**'
- '!frontend/stats/**'
- 'backend/**'
- '.github/workflows/run-playwright-on-pr.yaml'
- 'docker-compose.yml'
- 'Dockerfile'
- 'gitea/**'
- 'package.json'
- 'development/**'
workflow_dispatch:
jobs:
playwright-tests:
name: Build environment and run e2e test
# I need "packages: write" to access GHCR.
# More about permissions here: https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions: write-all
#permissions:
# id-token: write
# contents: read
timeout-minutes: 25
runs-on: ubuntu-latest
steps:
- name: 'Checking Out Code'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: 'Installing Dependencies'
uses: ./.github/actions/yarn-install
- name: Generate .env file
run: |
echo PLAYWRIGHT_TEST_APP=autodeploy-v3 >> .env
echo DEVELOP_APP_DEVELOPMENT=0 >> .env
echo DEVELOP_RESOURCE_ADMIN=0 >> .env
echo DEVELOP_BACKEND=0 >> .env
echo DEVELOP_DASHBOARD=0 >> .env
echo DEVELOP_PREVIEW=0 >> .env
echo GITEA_ADMIN_PASS=g9wDIG@6gf >> .env
echo GITEA_ADMIN_USER=localg1iteaadmin >> .env
echo GITEA_CYPRESS_USER=cypress_testuser >> .env
echo GITEA_CYPRESS_PASS=g9wDIG@6gf >> .env
echo GITEA_ORG_USER=ttd >> .env
echo POSTGRES_PASSWORD=kyeDIG@eip >> .env
echo COMMIT= >> .env
echo IGNORE_DOCKER_DNS_LOOKUP=true >> .env
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
run: docker buildx bake --file compose.yaml --file compose-cache.json
- name: Run setup.js script
run: |
node ./development/setup.js
- name: Playwright run
working-directory: frontend/testing/playwright
env:
environment: local
run: |
yarn setup:playwright
yarn playwright:test:all
- name: Stop compose file
if: always()
run: docker-compose down
- name: Store artifacts
uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-screenshots
path: frontend/testing/playwright/test-results