-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (77 loc) · 2.01 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
name: CI
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
lint:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14.x, 16.x]
steps:
# step 1
- uses: actions/checkout@v3
# with:
# submodules: recursive
# token: ${{ secrets.ACCESS_TOKEN }}
# step 2
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# step 3
- name: Checkout master
uses: actions/checkout@master
# step 4
- name: Cache node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
# step 5
- name: Install dependencies
if: steps.cache-primes.outputs.cache-hit != 'true'
run: yarn
# step 6
- name: Run code formatting
run: |
yarn prettier:format
yarn lint:js
yarn lint:style
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14.x, 16.x]
steps:
# step 1
- uses: actions/checkout@v3
# step 2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# step 3
- run: node --version
# step 4
- name: Checkout master
uses: actions/checkout@master
# step 5
- name: Install dependencies
run: |
yarn
yarn build
# step 6 https://github.com/marketplace/codecov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: actions ${{ matrix.node-version }}
fail_ci_if_error: false
# token: ${{ secrets.CODECOV_TOKEN }}