From 1a7b81941d68c809fdb21909de96040a7c6a5b33 Mon Sep 17 00:00:00 2001 From: Mikko Riippi Date: Fri, 20 Feb 2026 16:35:58 +0200 Subject: [PATCH 1/3] feat: move sonar to separate job RAT-358 --- .github/workflows/ci-node.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-node.yml b/.github/workflows/ci-node.yml index 7ad7f97..635b1c2 100644 --- a/.github/workflows/ci-node.yml +++ b/.github/workflows/ci-node.yml @@ -135,6 +135,8 @@ jobs: working-directory: ${{ inputs.working-directory }} steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Use Node.js ${{ inputs.node-version }} with dependency path if: ${{ inputs.working-directory != '.' }} uses: actions/setup-node@v4 @@ -171,9 +173,37 @@ jobs: run: yarn test:coverage env: CI: true + - name: Store coverage report + uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 + with: + path: ${{ (inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) && format('{0}/', inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) || ''}}coverage + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + sonarcloud: + name: Run SonarQube Cloud Scan + if: ${{ !inputs.skip_sonar }} + runs-on: ubuntu-latest + needs: tests + defaults: + run: + working-directory: ${{ inputs.working-directory }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Restore coverage report + uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 + with: + path: ${{ (inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) && format('{0}/', inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory) || ''}}coverage + key: cache-${{ github.run_id }}-${{ github.run_attempt }} + fail-on-cache-miss: true + # Without this workaround, SonarQube Cloud reports a warning about an incorrect source path + - name: Override coverage report source path for SonarQube Cloud + working-directory: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }} + run: | + find coverage -type f \( -name '*.info' -o -name 'lcov.info' \) 2>/dev/null | xargs -r sed -i 's@SF:'$GITHUB_WORKSPACE'@SF:/github/workspace/@g' || true + find coverage -type f -name '*.json' 2>/dev/null | xargs -r sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' || true - name: SonarQube Cloud Scan - if: ${{ !inputs.skip_sonar }} uses: SonarSource/sonarqube-scan-action@v6 with: projectBaseDir: ${{ inputs.app-directory == '.' && inputs.working-directory || inputs.app-directory }} From 5839c7f866b43291da8d028c168c08f5f83e806f Mon Sep 17 00:00:00 2001 From: Mikko Riippi Date: Mon, 23 Feb 2026 10:14:29 +0200 Subject: [PATCH 2/3] feat: remove unused fetch-depth RAT-358 --- .github/workflows/ci-node.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-node.yml b/.github/workflows/ci-node.yml index 635b1c2..7d15405 100644 --- a/.github/workflows/ci-node.yml +++ b/.github/workflows/ci-node.yml @@ -135,8 +135,6 @@ jobs: working-directory: ${{ inputs.working-directory }} steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Use Node.js ${{ inputs.node-version }} with dependency path if: ${{ inputs.working-directory != '.' }} uses: actions/setup-node@v4 From 690682ab3129deb02f523f2072974d375b08b313 Mon Sep 17 00:00:00 2001 From: Mikko Riippi Date: Tue, 24 Feb 2026 13:55:41 +0200 Subject: [PATCH 3/3] feat: add comments RAT-358 --- .github/workflows/ci-node.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci-node.yml b/.github/workflows/ci-node.yml index 7d15405..b318a1c 100644 --- a/.github/workflows/ci-node.yml +++ b/.github/workflows/ci-node.yml @@ -171,6 +171,9 @@ jobs: run: yarn test:coverage env: CI: true + # Coverage path logic (keep in sync with sonarcloud job's cache/restore step): + # Resolves the effective directory (app-directory if set, else working-directory), + # then prefixes 'coverage' with '/' when running in a subdirectory. - name: Store coverage report uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: @@ -189,6 +192,9 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + # Coverage path logic (keep in sync with tests job's cache/save step): + # Resolves the effective directory (app-directory if set, else working-directory), + # then prefixes 'coverage' with '/' when running in a subdirectory. - name: Restore coverage report uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 with: