-
-
Notifications
You must be signed in to change notification settings - Fork 338
102 lines (83 loc) · 2.2 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
102
name: Continuous Integration
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
setup:
name: Setup & Code Quality
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- name: Cache dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: |
**/node_modules
~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Check code format
run: yarn format
- name: Run linter
run: yarn lint
- name: Type check
run: yarn types
build-and-test:
name: Build & Test
needs: setup
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- name: Restore cache
uses: actions/cache@v3
with:
path: |
**/node_modules
~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Clean lib directory
run: yarn clean
- name: Build project
run: yarn prepare
- name: Run tests
run: yarn test:ci
- name: Upload coverage reports
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: ./coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true