Analyze #453
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: Analyze | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| schedule: | |
| - cron: 0 4 * * 0 | |
| jobs: | |
| dependencies: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Java JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: adopt | |
| - name: Setup gradlew | |
| run: chmod +x ./gradlew | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/wrapper | |
| ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: ${{ runner.os }}-gradle-caches- | |
| - name: Analyze Dependencies | |
| uses: mikepenz/gradle-dependency-submission@v0.9.0 | |
| sonarqube: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Setup Java JDK | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: adopt | |
| - name: Setup gradlew | |
| run: chmod +x ./gradlew | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/wrapper | |
| ~/.gradle/caches | |
| key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | |
| restore-keys: ${{ runner.os }}-gradle-caches- | |
| - name: Cache SonarCloud packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Build and analyze | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| BOT_TOKEN: ${{ secrets.TEST_BOT_TOKEN }} | |
| run: ./gradlew itest build sonarqube --info |