Skip to content

Commit 917fe79

Browse files
committed
chore: setup github pr status check
1 parent 10d9888 commit 917fe79

4 files changed

Lines changed: 42 additions & 2 deletions

File tree

.github/branch-protection.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Branch Protection Rules for main branch
2+
# This file documents the required status checks for pull requests
3+
4+
required_status_checks:
5+
strict: true
6+
contexts:
7+
- 'lint-and-typecheck'
8+
- 'test-coverage'
9+
- 'build'
10+
- 'build-example'
11+
12+
required_pull_request_reviews:
13+
required_approving_review_count: 1
14+
dismiss_stale_reviews: true
15+
require_code_owner_reviews: false
16+
17+
enforce_admins: false
18+
allow_force_pushes: false
19+
allow_deletions: false
20+
21+
restrictions: null

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: CI
2+
23
on:
34
push:
45
branches:
56
- main
67
pull_request:
78
branches:
89
- main
10+
pull_request_target:
11+
branches:
12+
- main
913
merge_group:
1014
types:
1115
- checks_requested
@@ -36,7 +40,7 @@ jobs:
3640
uses: ./.github/actions/setup
3741

3842
- name: Run unit tests
39-
run: yarn test --maxWorkers=2 --coverage
43+
run: yarn test --maxWorkers=2 --coverage --ci
4044

4145
build-library:
4246
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ android/keystores/debug.keystore
7676

7777
# generated by bob
7878
lib/
79+
coverage

package.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,21 @@
100100
],
101101
"setupFilesAfterEnv": [
102102
"<rootDir>/jest.setup.ts"
103-
]
103+
],
104+
"collectCoverageFrom": [
105+
"src/**/*.{ts,tsx}",
106+
"!src/**/*.d.ts",
107+
"!src/**/__tests__/**",
108+
"!src/**/index.tsx"
109+
],
110+
"coverageThreshold": {
111+
"global": {
112+
"branches": 80,
113+
"functions": 80,
114+
"lines": 80,
115+
"statements": 80
116+
}
117+
}
104118
},
105119
"commitlint": {
106120
"extends": [

0 commit comments

Comments
 (0)