Skip to content

Commit d3e95b6

Browse files
author
Gonzalo Diaz
committed
[CONFIG] Node script for github-actions. Split in 2: One for Coverage, the another to run multi-version/multi-OS tests.
1 parent 505de94 commit d3e95b6

File tree

3 files changed

+62
-6
lines changed

3 files changed

+62
-6
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Node.js CI Coverage
2+
3+
on:
4+
push:
5+
branches: [ "main", "develop", "feature/*" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
os: [
17+
"ubuntu-latest"
18+
]
19+
node-version: [20.x]
20+
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
25+
with:
26+
fetch-depth: 0
27+
- name: Set up Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
32+
- name: Install dependencies
33+
run: npm ci --verbose
34+
35+
- name: Lint
36+
run: npm run lint
37+
38+
- name: Run the tests
39+
run: npm test -- --coverage
40+
41+
- name: Upload coverage reports to Codecov with GitHub Action
42+
uses: codecov/codecov-action@v4
43+
with:
44+
token: ${{ secrets.CODECOV_TOKEN }} # required
45+
verbose: true # optional (default = false)

.github/workflows/node.js.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,3 @@ jobs:
4040

4141
- name: Test
4242
run: npm run test
43-
44-
- name: Upload coverage reports to Codecov with GitHub Action
45-
uses: codecov/codecov-action@v4
46-
with:
47-
token: ${{ secrets.CODECOV_TOKEN }} # required
48-
verbose: true # optional (default = false)

sonar-project.properties

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
sonar.projectKey=sir-gon_algorithm-exercises-js
2+
sonar.organization=sir-gon
3+
4+
# This is the name and version displayed in the SonarCloud UI.
5+
#sonar.projectName=algorithm-exercises-ts
6+
#sonar.projectVersion=1.0
7+
8+
9+
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
10+
sonar.sources=src
11+
sonar.exclusions=**/*.json,**/*.test.js,**/*.bruteforce-test.js,src/logger.js
12+
13+
# Encoding of the source code. Default is default system encoding
14+
sonar.sourceEncoding=UTF-8
15+
16+
# Coverage
17+
sonar.javascript.lcov.reportPaths=./coverage/lcov.info

0 commit comments

Comments
 (0)