-
-
Notifications
You must be signed in to change notification settings - Fork 13
48 lines (46 loc) · 1.43 KB
/
node_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Node CI
on: push
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x, 23.x]
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Build NPM package, run analysis and tests
run: |
npm install
npm run lint
npm run test
env:
CI: true
- if: matrix.node-version == '20.x'
name: Code Climate Coverage Action
uses: paambaati/[email protected]
with:
coverageCommand: npm run test:coverage
coverageLocations: ${{github.workspace}}/reports/coverage/lcov.info:lcov
env:
CC_TEST_REPORTER_ID: 6ace5bc20f45a4d3b1d1bd56b37e2ed97c92776e402f4f687bb5ee50853cb51c
- if: matrix.node-version == '20.x'
name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.projectKey=ngarbezza_testy
-Dsonar.organization=ngarbezza
-Dsonar.projectName=Testy
-Dsonar.projectVersion=7.1.0
-Dsonar.javascript.lcov.reportPaths=reports/coverage/lcov.info
-Dsonar.coverage.exclusions=tests/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}