From 30ac1a886566f403a54af506fbb17ec020cb8d3b Mon Sep 17 00:00:00 2001 From: zakie Date: Sun, 23 Nov 2025 05:03:43 +0900 Subject: [PATCH 1/4] =?UTF-8?q?chore:=20SonarCloud=20=EB=B6=84=EC=84=9D=20?= =?UTF-8?q?=EB=B0=8F=20Rust=20=EC=BB=A4=EB=B2=84=EB=A6=AC=EC=A7=80(grcov)?= =?UTF-8?q?=20CI=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sonarcloud.yml | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/sonarcloud.yml diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml new file mode 100644 index 0000000..76cd334 --- /dev/null +++ b/.github/workflows/sonarcloud.yml @@ -0,0 +1,50 @@ +name: SonarCloud + +on: + pull_request: + branches: + - develop + push: + branches: + - develop + +jobs: + sonarcloud: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Rust with Clippy + uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - name: Install grcov + run: cargo install grcov + + - name: Run tests with coverage instrumentation + run: | + CARGO_INCREMENTAL=0 \ + RUSTFLAGS="-Cinstrument-coverage" \ + LLVM_PROFILE_FILE="coverage-%p-%m.profraw" \ + cargo test --all --verbose + + - name: Generate coverage report (lcov) + run: | + grcov . \ + --binary-path ./target/debug/ \ + -s . -t lcov \ + --branch --ignore-not-existing \ + -o coverage.lcov + + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@v2 + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + args: > + -Dsonar.javascript.lcov.reportPaths=coverage.lcov From 466c1a92a037b099091690dc4fd75f9266455b2e Mon Sep 17 00:00:00 2001 From: zakie Date: Sun, 23 Nov 2025 05:20:48 +0900 Subject: [PATCH 2/4] =?UTF-8?q?chore:=20working-directory=20=EB=A3=A8?= =?UTF-8?q?=ED=8A=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sonarcloud.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 76cd334..fb33217 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -26,6 +26,7 @@ jobs: run: cargo install grcov - name: Run tests with coverage instrumentation + working-directory: backend run: | CARGO_INCREMENTAL=0 \ RUSTFLAGS="-Cinstrument-coverage" \ @@ -33,6 +34,7 @@ jobs: cargo test --all --verbose - name: Generate coverage report (lcov) + working-directory: backend run: | grcov . \ --binary-path ./target/debug/ \ @@ -42,6 +44,7 @@ jobs: - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@v2 + working-directory: backend env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5060309620f372da107df19d629d10eb72cce5d4 Mon Sep 17 00:00:00 2001 From: zakie Date: Sun, 23 Nov 2025 05:24:18 +0900 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20working-directory=20=EB=A3=A8?= =?UTF-8?q?=ED=8A=B8=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sonarcloud.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index fb33217..94981c7 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -44,10 +44,10 @@ jobs: - name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@v2 - working-directory: backend env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: > + -Dsonar.projectBaseDir=backend -Dsonar.javascript.lcov.reportPaths=coverage.lcov From 1267c8f55239c861a1377b9e2b7b3dea6795119d Mon Sep 17 00:00:00 2001 From: zakie Date: Sun, 23 Nov 2025 05:42:44 +0900 Subject: [PATCH 4/4] =?UTF-8?q?fix:=20projectKey/organization=20=EC=A7=81?= =?UTF-8?q?=EC=A0=91=20=EC=A7=80=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/sonarcloud.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 94981c7..2a5b957 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -49,5 +49,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: > - -Dsonar.projectBaseDir=backend + -Dsonar.projectBaseDir=backend + -Dsonar.projectKey=zzaekkii_challenge-to-do + -Dsonar.organization=zzaekkii -Dsonar.javascript.lcov.reportPaths=coverage.lcov