Skip to content

Commit 83d016e

Browse files
authored
lets start with coverage for app (#763)
* lets start with coverage for app * lint * better setup
1 parent 2aed84e commit 83d016e

File tree

3 files changed

+98
-0
lines changed

3 files changed

+98
-0
lines changed

app/.codecov.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: '80...100'
8+
status:
9+
project:
10+
default:
11+
target: 80%
12+
threshold: 5%
13+
patch:
14+
default:
15+
target: 80%
16+
threshold: 5%
17+
18+
flags:
19+
screens:
20+
paths:
21+
- 'src/screens/'
22+
stores:
23+
paths:
24+
- 'src/stores/'
25+
providers:
26+
paths:
27+
- 'src/providers/'
28+
components:
29+
paths:
30+
- 'src/components/'
31+
utils:
32+
paths:
33+
- 'src/utils/'
34+
hooks:
35+
paths:
36+
- 'src/hooks/'
37+
navigation:
38+
paths:
39+
- 'src/navigation/'
40+
layouts:
41+
paths:
42+
- 'src/layouts/'
43+
44+
ignore:
45+
- 'src/mocks/**'
46+
- 'src/types/**'
47+
- 'src/**/*.d.ts'
48+
- 'src/**/index.{ts,tsx}'
49+
- 'src/**/*.test.{ts,tsx}'
50+
- 'src/**/*.spec.{ts,tsx}'
51+
- 'src/**/__tests__/**'
52+
- 'src/**/__mocks__/**'
53+
- 'tests/**'
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Test and Coverage
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
paths:
7+
- 'app/**'
8+
- '.github/workflows/test-coverage.yml'
9+
pull_request:
10+
branches: [main, dev]
11+
paths:
12+
- 'app/**'
13+
- '.github/workflows/test-coverage.yml'
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Use Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '22'
26+
cache: 'yarn'
27+
28+
- name: Install dependencies
29+
run: |
30+
yarn install
31+
yarn build:deps
32+
working-directory: ./app
33+
34+
- name: Run tests with coverage
35+
run: yarn test:coverage:ci
36+
working-directory: ./app
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v4
40+
with:
41+
file: ./app/coverage/lcov.info
42+
flags: screens,stores,providers,components,utils,hooks,navigation,layouts
43+
token: ${{ secrets.CODECOV_TOKEN }}

app/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
"tag:release": "node scripts/tag.js release",
4646
"tag:remove": "node scripts/tag.js remove",
4747
"test": "jest --passWithNoTests",
48+
"test:coverage": "jest --coverage --passWithNoTests",
49+
"test:coverage:ci": "jest --coverage --passWithNoTests --ci --coverageReporters=lcov --coverageReporters=text --coverageReporters=json",
4850
"test:fastlane": "bundle exec ruby -Itest fastlane/test/helpers_test.rb",
4951
"types": "tsc --noEmit",
5052
"web": "vite",

0 commit comments

Comments
 (0)