-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (65 loc) · 2.06 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
name: Continuous Integration
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit-test:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Run test suites
run: pnpm run test
e2e-test:
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- id: playwright-cache-key
run: |
CACHE_KEYS=$(cat package.json | jq -r '.devDependencies."@playwright/test" | sub("\\^(?<x>[0-9].[0-9]*.[0-9]+)"; "\(.x)")')
echo "cache-key=$CACHE_KEYS" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-cache-key.outputs.cache-key }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install dependencies
run: pnpm install
- name: Install Playwright Browsers
if: ${{ !steps.playwright-cache.outputs.cache-hit }}
run: pnpm exec playwright install --with-deps
- name: Build app
run: pnpm run build
- name: Run Playwright tests
run: pnpm run test:e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30