diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 0c2126ee..1658be52 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,7 +11,7 @@ jobs: code-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: token: ${{ secrets.GH_TOKEN }} - run: git fetch --tags --unshallow @@ -20,7 +20,7 @@ jobs: uses: oat-sa/conventional-commit-action@v0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v4 with: node-version: 18.x registry-url: https://registry.npmjs.org @@ -34,7 +34,7 @@ jobs: npm run coverage:clover - name: Report coverage if: always() - uses: slavcodev/coverage-monitor-action@v1 + uses: slavcodev/coverage-monitor-action@1.9.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} coverage_path: coverage/clover.xml @@ -47,7 +47,7 @@ jobs: - name: Annotate Code Linting Results if: always() continue-on-error: true - uses: ataylorme/eslint-annotate-action@1.2.0 + uses: ataylorme/eslint-annotate-action@2.2.0 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' report-json: 'eslint_report.json' diff --git a/.github/workflows/release-package.yml b/.github/workflows/release-package.yml index 5fb0326c..d4a2f878 100644 --- a/.github/workflows/release-package.yml +++ b/.github/workflows/release-package.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Clone the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 #avoid unrelated history error token: ${{ secrets.SEMVER_GH_TOKEN }} #bypass branch protection rule diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml new file mode 100644 index 00000000..5cf09793 --- /dev/null +++ b/.github/workflows/sonar.yml @@ -0,0 +1,40 @@ +name: Sonarqube_CI +on: + + pull_request: + types: + - labeled + + push: + branches: + - master + - main + - release-* + +jobs: + build: + name: Sonarqube_CI + if: ${{ github.event.label.name == 'sonar_check' || github.event_name == 'push' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Sonarqube scan + uses: sonarsource/sonarqube-scan-action@master + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: 'https://sonarqube.taotesting.info/sonarqube/' + + # Job will fail when the Quality Gate is red + - name: Sonarqube quality gate check + id: sonarqube-quality-gate-check + uses: sonarsource/sonarqube-quality-gate-action@master + timeout-minutes: 5 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + + - name: "Example show SonarQube Quality Gate Status value" + run: echo "The Quality Gate status is ${{ steps.sonarqube-quality-gate-check.outputs.quality-gate-status }}" \ No newline at end of file diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..cdc741e7 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1 @@ +sonar.projectKey=expr-eval