-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.43 KB
/
Copy pathe2e-tests.yml
File metadata and controls
87 lines (71 loc) · 2.43 KB
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
name: E2E Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
playwright:
name: Run Playwright Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build result package
run: yarn workspace result build
- name: Refresh package links
run: yarn install --force
- name: Get Playwright version
id: playwright-version
run: echo "version=$(yarn list --pattern @playwright/test --depth=0 --json --non-interactive --no-progress | jq -r '.data.trees[0].name' | sed 's/@playwright\/test@//')" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Install Playwright system dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps
- name: Cache build artifacts
uses: actions/cache@v4
id: build-cache
with:
path: |
backend/dist
frontend/dist
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock', '**/package.json', '**/*.ts', '**/*.tsx', '!**/*.spec.ts', '!**/*.test.ts') }}
restore-keys: |
${{ runner.os }}-build-
- name: Build applications
if: steps.build-cache.outputs.cache-hit != 'true'
run: yarn build
- name: Run Playwright tests
run: yarn test:e2e
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results
path: test-results/
retention-days: 30