-
Notifications
You must be signed in to change notification settings - Fork 177
71 lines (67 loc) · 2.43 KB
/
ci.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
name: Continuous integration
on: [push]
jobs:
runner-job:
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install pnpm
run: npm install -g pnpm
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- uses: actions/cache@v4
name: Setup Playwright browsers cache
with:
path: /home/runner/.cache/ms-playwright/
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install packages
run: |
pnpm install
- name: Build
run: |
pnpm run production
- name: Lint
run: |
pnpm run lint
- name: Check types
run: |
pnpm run tsc
- name: Clean coverage
run: rm -rf .nyc_output && npx jest --clearCache
- name: Run jest tests
run: pnpm run jest
- name: Playwright install
run: npx playwright install chromium
- name: Run playwright tests
run: pnpm run playwright
- name: Screenshots artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: screenshots
path: src/playwright/playwright.test.ts-snapshots/
- name: Merge coverage
run: cp jest-coverage/coverage-final.json .nyc_output/coverage_jsdom.json
- name: Codecov
uses: codecov/codecov-action@v4
with:
directory: .nyc_output
verbose: true