-
-
Notifications
You must be signed in to change notification settings - Fork 59
101 lines (94 loc) · 2.58 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: CI
permissions:
contents: read
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install Parent Folder
run: npm install
- name: Run linting
run: npm run lint
unused:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install Parent Folder
run: npm install
- name: Run unused code checking
run: npm run unused
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install Parent Folder
run: npm install
- name: Ensure no package-lock.json changes
run: git diff --exit-code
- name: Build
run: npm run build
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install Parent Folder
run: npm install
- name: Test
run: npm run test
env:
CI: true
e2e-tests:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Install parent directory
run: npm install
- name: Get installed Playwright version
id: playwright-version
working-directory: ./e2e
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install e2e test
working-directory: ./e2e
run: npm install
- run: npx playwright install --with-deps
working-directory: ./e2e
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: npx playwright install-deps
working-directory: ./e2e
if: steps.playwright-cache.outputs.cache-hit != 'true'
- name: Run Playwright tests
working-directory: ./e2e
run: npm run test