-
Notifications
You must be signed in to change notification settings - Fork 10
89 lines (79 loc) · 2.53 KB
/
check.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
name: Check the test before merge
on:
# When Release Pull Request is merged
pull_request:
types: [opened, synchronize, ready_for_review]
branches:
- main
- staging
push:
branches:
- main
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
test:
strategy:
matrix:
node: ["18.18.0"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.0
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
./node_modules/
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: |
npm install -g yarn
yarn
- name: Run nx reset workspace
run: |
yarn nx reset
- name: Run test
run: |
yarn test
- name: Produce the coverage report
uses: insightsengineering/coverage-action@v2
with:
# Path to the Cobertura XML report.
path: ./coverage/cobertura-coverage.xml
# Minimum total coverage, if you want to the
# workflow to enforce it as a standard.
# This has no effect if the `fail` arg is set to `false`.
# threshold: 90
# Fail the workflow if the minimum code coverage
# reuqirements are not satisfied.
fail: false
# Publish the rendered output as a PR comment
publish: true
# Create a coverage diff report.
diff: true
# Branch to diff against.
# Compare the current coverage to the coverage
# determined on this branch.
diff-branch: main
# This is where the coverage reports for the
# `diff-branch` are stored.
# Branch is created if it doesn't already exist'.
# diff-storage: _xml_coverage_reports
coverage-summary-title: "Code Coverage Summary"
new-uncovered-statements-failure: true
# new-uncovered-statements-failure: true