77
88env :
99 CI : true
10+ GITHUB_BRANCH : ${{ github.ref }}
11+ GITHUB_HEAD_REF : ${{ github.head_ref }}
12+ GITHUB_BASE_REF : ${{ github.base_ref }}
13+ GITHUB_COMMIT : ${{ github.sha }}
1014
1115jobs :
1216 build :
@@ -15,12 +19,12 @@ jobs:
1519 strategy :
1620 matrix :
1721 os : [ubuntu-latest, macos-latest, windows-latest]
18- node-version : [10 .x, 12 .x, 13 .x, 14 .x]
22+ node-version : [12 .x, 13 .x, 14 .x, 16.x, 17 .x]
1923
2024 steps :
2125 - uses : actions/checkout@v2
2226 - name : Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
23- uses : actions/setup-node@v1
27+ uses : actions/setup-node@v2
2428 with :
2529 node-version : ${{ matrix.node-version }}
2630 - name : nodejs project information
2933 - name : npm install
3034 run : |
3135 npm install
36+ - name : npm test
37+ run : |
38+ npm test
39+ - name : npm run build
40+ run : |
41+ npm run build
3242 - name : code coverage
33- if : matrix.os == 'ubuntu-latest' && matrix.node-version == '14 .x'
43+ if : matrix.os == 'ubuntu-latest' && matrix.node-version == '16 .x'
3444 uses : coverallsapp/github-action@master
3545 with :
3646 github-token : ${{ secrets.GITHUB_TOKEN }}
3747 path-to-lcov : ./test/coverage/lcov.info
48+ - name : publish code coverage to code climate
49+ if : matrix.os == 'ubuntu-latest' && matrix.node-version == '16.x'
50+ uses : paambaati/codeclimate-action@v3.0.0
51+ env :
52+ CC_TEST_REPORTER_ID : ${{ secrets.CC_TEST_REPORTER_ID }}
53+ with :
54+ coverageCommand : npm test
55+ coverageLocations : |
56+ ./test/coverage/lcov.info:lcov
57+ - name : run codacy-coverage-reporter
58+ if : matrix.os == 'ubuntu-latest' && matrix.node-version == '16.x'
59+ uses : codacy/codacy-coverage-reporter-action@master
60+ with :
61+ project-token : ${{ secrets.CODACY_PROJECT_TOKEN }}
62+ coverage-reports : ./test/coverage/lcov.info
63+ - name : Publish Unit Test Results
64+ uses : EnricoMi/publish-unit-test-result-action/composite@v1
65+ with :
66+ check_name : Unit Test Results node${{ matrix.node-version }}-${{ matrix.os }}
67+ files : test/junit.xml
0 commit comments