-
-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (56 loc) · 1.86 KB
/
tests.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
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Vitest and Playwright
if: (github.event_name == 'pull_request')
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
- name: Run Vitest tests
run: npm run test:ci
env:
API_URL: ${{ secrets.API_URL }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
MSW_ENABLED: ${{ secrets.MSW_ENABLED }}
npm_package_version: ${{ steps.package-version.outputs.current-version}}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
SITE_URL: ${{ secrets.SITE_URL }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
env:
API_URL: ${{ secrets.API_URL }}
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
MSW_ENABLED: ${{ secrets.MSW_ENABLED }}
npm_package_version: ${{ steps.package-version.outputs.current-version}}
SESSION_SECRET: ${{ secrets.SESSION_SECRET }}
SITE_URL: ${{ secrets.SITE_URL }}
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
name: Upload Playwright failed test traces
with:
name: playwright-traces
path: .playwright/output
retention-days: 5