Skip to content

Commit 354a9b9

Browse files
committed
chore(github-actions): add code coverage to the github actions
1 parent 7167f93 commit 354a9b9

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

.github/workflows/main.yml .github/workflows/main.yaml

+13-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ name: UI Lint & Unit Tests
44
on:
55
# Triggers the workflow on pull request events but only for the main branch
66
pull_request:
7-
types: [opened, synchronize, reopened]
87
branches:
98
- main
109

@@ -23,19 +22,26 @@ jobs:
2322
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2423
- name: Checkout 🛎️
2524
uses: actions/checkout@v4
26-
- name: Setup ⚙️ Node.js ${{ matrix.node-version }}
25+
- name: Setup ⚙️ Node.js ${{ matrix.node-version }} 🔰
2726
uses: actions/setup-node@v4
2827
with:
2928
node-version: ${{ matrix.node-version }}
3029
cache: 'yarn'
31-
30+
3231
- name: Install Dependencies 🥁
3332
run: yarn install --frozen-lockfile
34-
33+
3534
- name: Lint ✅
3635
run: yarn lint
37-
38-
- name: Run unit tests
39-
run: yarn test --maxWorkers=2
36+
37+
- name: Run unit tests 🧪
38+
run: yarn test --maxWorkers=2 --coverage
4039
env:
4140
CI: true
41+
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v4
44+
with:
45+
file: ./coverage/lcov.info
46+
flags: unittests
47+
fail_ci_if_error: true

codecv.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
codecov:
2+
require_ci_to_pass: true
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "70...100"
8+
status:
9+
project:
10+
default:
11+
target: auto
12+
threshold: 0.2%
13+
patch:
14+
default:
15+
target: 80% # coverage for new/modified code
16+
threshold: 1%
17+
18+
ignore:
19+
- "**/*__data__*/*.ts"
20+
21+
comment:
22+
layout: "reach,diff,flags,files,footer"
23+
behavior: default
24+
require_changes: false

0 commit comments

Comments
 (0)