-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (80 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
77
78
79
80
81
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
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run lint
run: bun 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
- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run unit tests
run: bun run test
e2e-tests:
runs-on: ubuntu-latest
steps:
- 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: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Install Playwright Browsers
run: bunx playwright install --with-deps
- name: Run Playwright tests
run: bunx 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