-
Notifications
You must be signed in to change notification settings - Fork 30
56 lines (47 loc) · 1.45 KB
/
tests.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
name: Unit Tests
on:
schedule:
- cron: '0 0 * * *'
push:
pull_request:
jobs:
default:
strategy:
matrix:
node: [16, 18]
os: [macos-latest, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Skip when run node.js@18 on ubuntu for compatibility reason
id: is_skip
if: matrix.os == 'ubuntu-22.04' && matrix.node == '18'
run: echo 'IS_SKIP=true' >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
- name: Setup Node
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Restore
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
uses: actions/cache@v3
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Deps
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
run: npm install
- name: Compile
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
run: npx lerna run tsc
- name: Test
if: ${{ steps.is_skip.outputs.IS_SKIP != 'true' }}
run: yarn run test
- name: Upload codecov
if: matrix.os == 'macos-latest' && matrix.node == '18'
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true