-
-
Notifications
You must be signed in to change notification settings - Fork 42
100 lines (76 loc) · 2.34 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
name: CI
on: [push, pull_request]
env:
FORCE_COLOR: true
jobs:
test:
name: Test (${{ matrix.node_version}}-${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [14, 16, 18]
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use node ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Restore cache
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ matrix.os }}-${{ matrix.node_version}}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ matrix.os }}-${{ matrix.node_version }}-yarn-
- name: Install yarn dependencies
run: yarn install
- name: Bootstrap lerna packages
run: yarn bootstrap
- name: Lint source code
run: yarn lint
if: ${{ matrix.node_version == 18 }}
- name: Jest with code coverage
if: ${{ matrix.node_version == 18 }}
run: yarn test:coverage
- name: Jest
if: ${{ matrix.node_version != 18 }}
run: yarn jest
- name: Upload test coverage to Code Climate
if: ${{ matrix.node_version == 18 }}
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: 7a4b78747587abb295ccb41439d7d067b9de2d885a766e7e88d5e8409599d2ea
build:
name: Build (${{ matrix.node_version}}-${{ matrix.os }})
needs: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [18]
os: [ubuntu-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Use node ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- name: Restore cache
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ matrix.os }}-${{ matrix.node_version}}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ matrix.os }}-${{ matrix.node_version }}-yarn-
- name: Install yarn dependencies
run: yarn install
- name: Bootstrap lerna packages
run: yarn bootstrap
- name: Build lerna packages
run: yarn build
- name: Lint package sizes
run: yarn size