Skip to content

Commit dc41205

Browse files
committed
[#383] Support Github PR comment
[#383] Support Github PR comment
1 parent 7766bf9 commit dc41205

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

.github/workflows/main.yml

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
name: CI
44

5-
# Controls when the action will run.
65
on: [push, pull_request]
76

8-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
7+
env:
8+
TARGET_COVERAGE_NODE_VERSION: '20'
9+
910
jobs:
10-
# This workflow contains a single job called "build"
11-
test:
12-
# The type of runner that the job will run on
11+
report-coverage:
1312
runs-on: ubuntu-latest
13+
permissions:
14+
pull-requests: write
1415
strategy:
1516
matrix:
1617
node_version:
@@ -34,24 +35,16 @@ jobs:
3435
# with:
3536
# path: '**/checkstyle-result.xml'
3637
- name: Coverage
38+
if: matrix.node_version == env.TARGET_COVERAGE_NODE_VERSION
3739
run: npm run coverage
38-
# Required for generating html artifact, can be skipped if not generating html artifact
39-
# - name: Report coverage
40-
# uses: hrishikesh-kadam/setup-lcov@v1
41-
# - name: Upload coverage report
42-
# uses: kefasjw/lcov-pull-request-report@v1
43-
# with:
44-
# # Lcov file location. For example, coverage/lcov.info
45-
# lcov-file: coverage/lcov.info
46-
47-
# # Github token required for getting list of changed files and posting comments
48-
# github-token: ${{ secrets.GITHUB_TOKEN }}
49-
# ... Generate LCOV files or download it from a different job
50-
# - name: Setup LCOV
51-
# uses: hrishikesh-kadam/setup-lcov@v1
52-
# - name: Report coverage
53-
# uses: zgosalvez/github-actions-report-lcov@v4
54-
# with:
55-
# coverage-files: coverage/lcov.info
56-
# github-token: ${{ secrets.ACTIONS_TOKEN }}
57-
# update-comment: true
40+
- name: Setup LCOV
41+
if: matrix.node_version == env.TARGET_COVERAGE_NODE_VERSION
42+
uses: hrishikesh-kadam/setup-lcov@v1
43+
- name: Report code coverage
44+
if: matrix.node_version == env.TARGET_COVERAGE_NODE_VERSION
45+
uses: zgosalvez/github-actions-report-lcov@v4
46+
with:
47+
coverage-files: coverage/lcov.info
48+
artifact-name: code-coverage-report
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
update-comment: true

0 commit comments

Comments
 (0)