File tree 5 files changed +80
-5
lines changed
5 files changed +80
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Annotate CI run with test results
2
+ on :
3
+ workflow_run :
4
+ workflows :
5
+ - " Run Tests"
6
+ types :
7
+ - completed
8
+ permissions :
9
+ actions : read
10
+ contents : read
11
+ checks : write
12
+ pull-requests : write
13
+
14
+ jobs :
15
+ annotate :
16
+ name : Annotate CI run with test results
17
+ runs-on : ubuntu-latest
18
+ if : ${{ github.event.workflow_run.conclusion != 'cancelled' }}
19
+ strategy :
20
+ fail-fast : false
21
+ matrix :
22
+ node-version : [18.x, 20.x, 22.x]
23
+ timeout-minutes : 5
24
+ steps :
25
+ - name : Annotate CI run with test results
26
+ uses : dorny/test-reporter@v1.8.0
27
+ with :
28
+ artifact : test-reports-${{ matrix.node-version }}
29
+ name : Test Results (${{matrix.node-version}}
30
+ path : " test-results.json"
31
+ reporter : mocha-json
Original file line number Diff line number Diff line change
1
+ name : Comment PR Coverage
2
+ on :
3
+ pull_request :
4
+ branches :
5
+ - ' main'
6
+ permissions :
7
+ contents : read
8
+ pull-requests : write
9
+
10
+ jobs :
11
+ coverage_report :
12
+ name : Generate coverage report
13
+ runs-on : ubuntu-latest
14
+ strategy :
15
+ matrix :
16
+ node-version : [20.x]
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+
20
+ - name : Use Node.js ${{ matrix.node-version }}
21
+ uses : actions/setup-node@v4
22
+ with :
23
+ node-version : ${{ matrix.node-version }}
24
+ cache : ' npm'
25
+
26
+ - name : Install Node Modules
27
+ run : npm ci
28
+
29
+ - name : Run Coverage Check
30
+ run : npm run lcov
31
+
32
+ - name : Setup LCOV
33
+ uses : hrishikesh-kadam/setup-lcov@v1
34
+
35
+ - name : Report code coverage
36
+ uses : zgosalvez/github-actions-report-lcov@v3
37
+ with :
38
+ coverage-files : coverage/lcov.info
39
+ minimum-coverage : 90
40
+ artifact-name : code-coverage-report
41
+ github-token : ${{ secrets.GITHUB_TOKEN }}
42
+ update-comment : true
Original file line number Diff line number Diff line change 8
8
- main
9
9
permissions :
10
10
contents : read
11
+ checks : write
12
+ pull-requests : write
11
13
12
14
jobs :
13
15
build :
34
36
- name : Run Tests and Linting
35
37
run : npm run test
36
38
37
- - uses : actions/upload-artifact@v3
39
+ - uses : actions/upload-artifact@v4
38
40
with :
39
41
name : test-reports-${{ matrix.node-version }}
40
42
path : test/reports/
Original file line number Diff line number Diff line change 27
27
"build" : " npm run clean && npm run compile && npm run add-package-jsons" ,
28
28
"watch" : " tsc --watch" ,
29
29
"prepublishOnly" : " npm run build" ,
30
- "test:unit" : " mocha --recursive --full-trace --exit" ,
30
+ "test:unit" : " mocha --recursive --full-trace --exit --reporter json > test/reports/test-results.json " ,
31
31
"pretest:integration:init" : " npm run build" ,
32
32
"test:integration:init" : " sh ./test/scripts/initIntTests.sh" ,
33
33
"test:integration" : " npm run test:integration:init && cucumber-js --config ./test/config/cucumber.mjs" ,
Original file line number Diff line number Diff line change 1
1
export default {
2
2
parallel : 0 ,
3
- format : [ 'html :test/reports/cucumber-report.html' ] ,
4
- paths : [ ' test/features' ] ,
5
- forceExit : true
3
+ format : [ "json :test/reports/cucumber-report.json" ] ,
4
+ paths : [ " test/features" ] ,
5
+ forceExit : true ,
6
6
} ;
You can’t perform that action at this time.
0 commit comments