Skip to content

Commit

Permalink
ci: fix PR check worflow
Browse files Browse the repository at this point in the history
- Added jest-junit reporting
- Fixed test job
- Removed unnecessary reports from lint and typecheck jobs
  • Loading branch information
mthahzan committed Dec 17, 2024
1 parent a992184 commit cab82a7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 35 deletions.
40 changes: 5 additions & 35 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ jobs:
include-hidden-files: true
if-no-files-found: error

# - name: Upload yarn cache
# id: cache-deps
# uses: actions/cache@v3
# with:
# path: |
# ~/.cache/yarn
# node_modules
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

run-lint:
name: Lint
runs-on: ubuntu-latest
Expand Down Expand Up @@ -84,17 +75,6 @@ jobs:
- name: Run lint
run: yarn lint

- name: Lint Report
uses: dorny/test-reporter@v1
if: success()
with:
name: Lint

- name: Lint Summary
uses: test-summary/action@v2
with:
paths: 'reports/lint.xml'

run-tests:
name: Test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -128,16 +108,17 @@ jobs:

- name: Test Report
uses: dorny/test-reporter@v1
if: success()
if: success() || failure()
with:
name: Tests
path: reports/junit.xml
name: Lint
path: reports/test-results.xml
reporter: jest-junit

- name: Test Summary
uses: test-summary/action@v2
if: always()
with:
paths: 'reports/junit.xml'
paths: 'reports/test-results.xml'

run-typecheck:
name: Type Check
Expand Down Expand Up @@ -169,14 +150,3 @@ jobs:

- name: Run type check
run: yarn typecheck

- name: Type Check Report
uses: dorny/test-reporter@v1
if: success()
with:
name: Type Check

- name: Type Check Summary
uses: test-summary/action@v2
with:
paths: 'reports/typecheck.xml'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ lib/
# React Native Codegen
ios/generated
android/generated

# Generated by tools
reports/*
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "^29.7.0",
"jest-junit": "^16.0.0",
"prettier": "^3.0.3",
"react": "18.2.0",
"react-native": "0.75.4",
Expand Down Expand Up @@ -102,8 +103,16 @@
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
],
"reporters": [
"default",
"jest-junit"
]
},
"jest-junit": {
"outputDirectory": "reports",
"outputName": "test-results.xml"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
Expand Down
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9402,6 +9402,18 @@ __metadata:
languageName: node
linkType: hard

"jest-junit@npm:^16.0.0":
version: 16.0.0
resolution: "jest-junit@npm:16.0.0"
dependencies:
mkdirp: ^1.0.4
strip-ansi: ^6.0.1
uuid: ^8.3.2
xml: ^1.0.1
checksum: 412aa4bfeec4254a9b34f417fda79107c7cbd295e56ffeb299ac9c977545910fbabe57c91c6cd1f12b700d4a1f60f79872b0075003f02da87d463e30fc2d9d78
languageName: node
linkType: hard

"jest-leak-detector@npm:^29.7.0":
version: 29.7.0
resolution: "jest-leak-detector@npm:29.7.0"
Expand Down Expand Up @@ -12359,6 +12371,7 @@ __metadata:
eslint-config-prettier: ^9.0.0
eslint-plugin-prettier: ^5.0.1
jest: ^29.7.0
jest-junit: ^16.0.0
prettier: ^3.0.3
react: 18.2.0
react-native: 0.75.4
Expand Down Expand Up @@ -15173,6 +15186,13 @@ __metadata:
languageName: node
linkType: hard

"xml@npm:^1.0.1":
version: 1.0.1
resolution: "xml@npm:1.0.1"
checksum: 11b5545ef3f8fec3fa29ce251f50ad7b6c97c103ed4d851306ec23366f5fa4699dd6a942262df52313a0cd1840ab26256da253c023bad3309d8ce46fe6020ca0
languageName: node
linkType: hard

"xmlbuilder@npm:^14.0.0":
version: 14.0.0
resolution: "xmlbuilder@npm:14.0.0"
Expand Down

0 comments on commit cab82a7

Please sign in to comment.