Skip to content

Commit 12faa10

Browse files
authored
Merge pull request #417 from sir-gon/develop
Develop
2 parents 505de94 + 8bd8101 commit 12faa10

File tree

5 files changed

+73
-11
lines changed

5 files changed

+73
-11
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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: [22.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)
46+
47+
- name: SonarCloud Scan
48+
uses: SonarSource/sonarcloud-github-action@master
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
51+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.github/workflows/node.js.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Node.js CI
4+
name: Node.js CI Tests
55

66
on:
77
push:
@@ -21,7 +21,7 @@ jobs:
2121
"ubuntu-latest",
2222
"macOS-latest"
2323
]
24-
node-version: [18.x, 19.x, 20.x]
24+
node-version: [18.x, 20.x, 22.x]
2525
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
2626

2727
steps:
@@ -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)

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM node:20.2.0-alpine3.16 AS base
1+
FROM node:22.1.0-alpine3.19 AS base
22

33
RUN apk add --update --no-cache make
44

55
ENV WORKDIR=/app
66
WORKDIR ${WORKDIR}
77

8-
FROM node:20.2.0-alpine3.16 AS lint
8+
FROM node:22.1.0-alpine3.19 AS lint
99

1010
ENV WORKDIR=/app
1111
WORKDIR ${WORKDIR}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Developed with runtime:
147147

148148
```text
149149
node --version
150-
v20.5.0
150+
v22.1.0
151151
```
152152

153153
### License

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)