Skip to content

Commit

Permalink
Feature/refactor (#29)
Browse files Browse the repository at this point in the history
* refactor: merge `RUN` instruction with the consecutive ones

* ci: upgrade `actions/checkout` and `actions/setup-node` to `v4`

* ci/refactor: lock `SonarSource/sonarcloud-github-action` to `v2`

* ci: exclude unit tests from duplication check

* build: bump package version to `1.4.5`
  • Loading branch information
phwt authored Aug 14, 2024
1 parent 0dc7672 commit e6daa1b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: npm

Expand All @@ -29,7 +29,7 @@ jobs:
npm test
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarcloud-github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -38,6 +38,7 @@ jobs:
-Dsonar.organization=phwt
-Dsonar.projectKey=sonarqube-quality-gate-action
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.cpd.exclusions=**/__tests__/*.ts
- name: Wait for the quality gate result
run: sleep 5
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
name: Check code quality on pull request branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
cache: npm

Expand All @@ -27,7 +27,7 @@ jobs:
npm test
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
uses: SonarSource/sonarcloud-github-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -37,6 +37,7 @@ jobs:
-Dsonar.projectKey=sonarqube-quality-gate-action
-Dsonar.javascript.lcov.reportPaths=./coverage/lcov.info
-Dsonar.branch.name=${{ github.event.pull_request.head.ref }}
-Dsonar.cpd.exclusions=**/__tests__/*.ts
- name: Wait for the quality gate result
run: sleep 5
Expand All @@ -60,7 +61,7 @@ jobs:
name: Retrieve quality gate result of the main branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM node:20-alpine

COPY . .
RUN npm ci && npm install -g typescript
RUN tsc
RUN npm ci && npm install -g typescript && tsc

ENTRYPOINT ["node", "/src/index.js"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sonarqube-quality-gate-action",
"version": "1.4.4",
"version": "1.4.5",
"description": "",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit e6daa1b

Please sign in to comment.