-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (35 loc) · 1.03 KB
/
unit-test.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
# 1.setup node env
# 2.unit test
# 3.upload coverage
name: unit-test
on: [push, pull_request]
# This ensures that previous jobs for the PR are canceled when the PR is updated.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
jest-run:
runs-on: ubuntu-20.04
# let's make sure our tests pass on Chrome browser
name: Jest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node env and build
uses: actions/setup-node@v3
with:
node-version: 16.13
cache: 'yarn'
cache-dependency-path: yarn.lock
- name: Install dependencies
run: |
yarn cache clean
yarn config set strict-ssl false
rm -rf yarn.lock
yarn install --frozen-lockfile
- name: Unit test
run: yarn run test:unit:coverage
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3