Skip to content

Develop #417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/node-coverage.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Node.js CI Coverage

on:
push:
branches: [ "main", "develop", "feature/*" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
os: [
"ubuntu-latest"
]
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- name: Checkout repository
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci --verbose

- name: Lint
run: npm run lint

- name: Run the tests
run: npm test -- --coverage

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
10 changes: 2 additions & 8 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: Node.js CI Tests

on:
push:
Expand All @@ -21,7 +21,7 @@ jobs:
"ubuntu-latest",
"macOS-latest"
]
node-version: [18.x, 19.x, 20.x]
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -40,9 +40,3 @@ jobs:

- name: Test
run: npm run test

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM node:20.2.0-alpine3.16 AS base
FROM node:22.1.0-alpine3.19 AS base

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

ENV WORKDIR=/app
WORKDIR ${WORKDIR}

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

ENV WORKDIR=/app
WORKDIR ${WORKDIR}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Developed with runtime:

```text
node --version
v20.5.0
v22.1.0
```

### License
Expand Down
17 changes: 17 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
sonar.projectKey=sir-gon_algorithm-exercises-js
sonar.organization=sir-gon

# This is the name and version displayed in the SonarCloud UI.
#sonar.projectName=algorithm-exercises-ts
#sonar.projectVersion=1.0


# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=src
sonar.exclusions=**/*.json,**/*.test.js,**/*.bruteforce-test.js,src/logger.js

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

# Coverage
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
Loading