-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (75 loc) · 2.22 KB
/
test.yml
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
name: Run Tests
on:
workflow_run:
workflows: ["Deploy to Staging"]
types:
- completed
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run lint
run: npm run lint
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Install dependencies
run: npm install
- name: Run unit tests
run: npm test
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: List all artifacts
run: |
curl -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/actions/artifacts
- name: Download deploy URL
id: download-artifact
uses: dawidd6/action-download-artifact@v3
with:
workflow: "deploy_staging.yml"
workflow_conclusion: "success"
name: "deploy-url"
- name: Set deploy URL
id: url
run: echo "DEPLOY_URL=$(cat deploy-url.txt)" >> $GITHUB_ENV
- name: Debug deploy URL
run: 'echo "DEPLOY_URL: ${{ env.DEPLOY_URL }}"'
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
env:
VITE_AUTH0_TEST_USERNAME: ${{ secrets.VITE_AUTH0_TEST_USERNAME }}
VITE_AUTH0_TEST_PASSWORD: ${{ secrets.VITE_AUTH0_TEST_PASSWORD }}
PLAYWRIGHT_TEST_BASE_URL: ${{ env.DEPLOY_URL }}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30