-
Notifications
You must be signed in to change notification settings - Fork 0
ci: set up SonarCloud analysis and Rust coverage upload #57
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
+105
−3
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cd2e1b9
ci: SonarCloud 분석 및 TS·Rust 커버리지 업로드 추가
amondnet 97ace7a
docs: README에 SonarCloud Quality Gate 배지 추가
amondnet 1c06c8f
ci: Rust 커버리지를 Codecov에도 업로드
amondnet 8b3d4e1
ci: Codecov flag·component로 언어별 커버리지 분리
amondnet c7dea64
Merge remote-tracking branch 'origin/main' into amondnet/sonarqube-badge
amondnet 0e9b9f1
chore: apply AI code review suggestions
amondnet 20bb022
chore: apply AI code review suggestions
amondnet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| name: Sonar | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
amondnet marked this conversation as resolved.
|
||
| pull-requests: read | ||
|
|
||
| concurrency: | ||
| group: sonar-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| sonar: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | ||
| with: | ||
| # Full history so SonarQube Cloud can attribute new code / blame. | ||
| fetch-depth: 0 | ||
|
|
||
| # --- Rust coverage (coverage/rust-lcov.info) --- | ||
| # rust-toolchain.toml uses `profile = "minimal"`, so the llvm-tools-preview | ||
| # component (required by cargo-llvm-cov) is not present by default. | ||
| - name: Add llvm-tools-preview component | ||
| run: rustup component add llvm-tools-preview | ||
|
|
||
| - name: Install cargo-llvm-cov | ||
| uses: taiki-e/install-action@9e1e5806d4a4822de933115878265be9aaa786d9 # v2 | ||
| with: | ||
| tool: cargo-llvm-cov | ||
|
|
||
| - name: Test with coverage (Rust) | ||
| # #[ignore] (network-gated) tests are excluded by default, keeping this | ||
| # offline (see ADR-0004). --all-features mirrors the Rust CI gate. | ||
| run: | | ||
| mkdir -p coverage | ||
| cargo llvm-cov --workspace --locked --all-features --lcov --output-path coverage/rust-lcov.info | ||
|
|
||
| - name: Upload Rust coverage to Codecov | ||
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | ||
| with: | ||
| files: ./coverage/rust-lcov.info | ||
| flags: rust | ||
| fail_ci_if_error: false | ||
| env: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
|
||
| # --- SonarQube Cloud analysis --- | ||
| # On pull_request runs from forks the SONAR_TOKEN secret isn't exposed, so | ||
| # skip the scan there instead of blocking external PRs. On push (main) the | ||
| # scan always runs — a missing token then fails loudly so a misconfigured | ||
| # Sonar setup is surfaced rather than silently skipped. (env is checked | ||
| # because the `secrets` context isn't available in step `if:` conditions.) | ||
| - name: SonarQube Cloud scan | ||
| if: ${{ github.event_name != 'pull_request' || env.SONAR_TOKEN != '' }} | ||
| uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # SonarQube Cloud (sonarcloud.io) configuration. | ||
| # | ||
| # Analysis runs from CI (.github/workflows/sonar.yml). For this to work the | ||
| # SonarCloud project must have Automatic Analysis DISABLED and a SONAR_TOKEN | ||
| # secret configured in the repository (or org) settings. | ||
| sonar.projectKey=pleaseai_code-search | ||
| sonar.organization=pleaseai | ||
|
|
||
| # The implementation is the Rust workspace under crates/ (the deprecated TS port | ||
| # that lived in src/ has been removed). | ||
| sonar.sources=crates | ||
|
|
||
| # Keep the npm launcher, build output, and dependency/target dirs out of analysis | ||
| # (npm/** mirrors the .codacy.yaml exclusion). | ||
| sonar.exclusions=npm/**,dist/**,target/**,node_modules/** | ||
|
|
||
| # Coverage report (LCOV), generated by `cargo llvm-cov` in CI before the scan step. | ||
| sonar.rust.lcov.reportPaths=coverage/rust-lcov.info | ||
|
amondnet marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.