Add Sonar analysis to repository #5
Workflow file for this run
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: Shadow scans | |
| on: | |
| pull_request: | |
| schedule: | |
| # Run the workflow every day at 01:00 UTC | |
| - cron: "0 1 * * *" | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: read | |
| statuses: read | |
| checks: read | |
| jobs: | |
| build: | |
| runs-on: github-ubuntu-latest-s | |
| name: Build | |
| if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'shadow_scan') | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 | |
| with: | |
| version: 2025.7.12 | |
| - name: Create Gradle User Home | |
| shell: bash | |
| run: | | |
| export GRADLE_USER_HOME=${GITHUB_WORKSPACE}/.gradle | |
| mkdir -p ${GRADLE_USER_HOME} | |
| echo "GRADLE_USER_HOME=${GRADLE_USER_HOME}" >> $GITHUB_ENV | |
| export TODAY=$(date '+%Y-%m-%d') | |
| echo "TODAY=${TODAY}" >> $GITHUB_ENV | |
| find . -name '*.gradle.kts' -type f -exec md5sum {} \; | sort && md5sum gradle/libs.versions.toml && md5sum gradle/wrapper/gradle-wrapper.properties && md5sum gradle.properties > gradle-md5-sums.txt | |
| export GRADLE_CACHE_KEY=$(md5sum gradle-md5-sums.txt | awk '{ print $1 }') | |
| echo "GRADLE_CACHE_KEY=${GRADLE_CACHE_KEY}" >> $GITHUB_ENV | |
| rm gradle-md5-sums.txt | |
| - name: Cache Gradle Dependencies | |
| uses: SonarSource/ci-github-actions/cache@v1 | |
| with: | |
| path: ${{ env.GRADLE_USER_HOME }} | |
| key: gradle-${{ env.GRADLE_CACHE_KEY }} | |
| - uses: SonarSource/ci-github-actions/build-gradle@v1 | |
| with: | |
| deploy: false | |
| use-develocity: false | |
| artifactory-reader-role: private-reader | |
| run-shadow-scans: 'true' | |
| # Disable develocity for shadow scans | |
| gradle-args: --no-scan | |
| disable-caching: 'true' | |
| - name: Run IRIS Analysis | |
| uses: SonarSource/unified-dogfooding-actions/run-iris@v1 | |
| with: | |
| primary_project_key: "SonarSource_cloud-native-gradle-modules" | |
| primary_platform: "Next" | |
| shadow1_project_key: "SonarSource_cloud-native-gradle-modules" | |
| shadow1_platform: "SQC-EU" | |
| shadow2_project_key: "SonarSource_cloud-native-gradle-modules" | |
| shadow2_platform: "SQC-US" |