-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.58 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Unit Test
on: [pull_request]
jobs:
unit-test:
runs-on: ubuntu-22.04
name: Test
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: moonrepo/setup-toolchain@v0
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Cache Moonrepo
uses: actions/cache@v4
with:
path: |
.moon/cache/hashes
.moon/cache/outputs
key: cache-moon-${{ github.sha }}
restore-keys: |
cache-moon-
- run: moon ci :build
- uses: moonrepo/run-report-action@v1
if: success() || failure()
with:
access-token: ${{ secrets.GITHUB_TOKEN }}
- run: moon run :test-coverage
- uses: actions/cache/restore@v4
with:
key: base-coverage-${{ github.run_id }}
path: |
./coverage/base.info
restore-keys: |
base-coverage-
base-coverage
- name: Generate Code Coverage report
id: code-coverage
uses: barecheck/code-coverage-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info
base-lcov-file: ./coverage/base.info
send-summary-comment: true
show-annotations: warning
- run: yarn install
- uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: minify
skip_step: install