Sonar #14
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
| name: Sonar | |
| # SonarCloud analysis runs once per day (07:00 UTC) on main, plus on-demand | |
| # via the workflow_dispatch button. Kept out of the per-push CI workflow to | |
| # keep PRs fast and reduce SonarCloud quota usage. | |
| on: | |
| schedule: | |
| - cron: '0 7 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| sonar: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout (with zstd submodule) | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| # Full history needed for line-level blame / new-code computation. | |
| fetch-depth: 0 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| cache: maven | |
| - name: Set up Zig | |
| uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 | |
| with: | |
| version: 0.16.0 | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Build, test, and Sonar analysis | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| ./mvnw -B -ntp verify -P coverage \ | |
| org.sonarsource.scanner.maven:sonar-maven-plugin:sonar |