fix: disable Sentry metrics - API not available in v8.31.0 #179
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: SonarQube | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**.md' | |
| - 'website/**' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - 'SECURITY.md' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths-ignore: | |
| - '**.md' | |
| - 'website/**' | |
| - 'docs/**' | |
| - 'LICENSE' | |
| - 'SECURITY.md' | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| sonarqube: | |
| name: SonarQube Analysis | |
| runs-on: ubuntu-latest | |
| environment: staging | |
| # Skip if no token (e.g., Dependabot PRs don't have access to secrets) | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: 21 | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Cache SonarQube packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.sonar/cache | |
| key: ${{ runner.os }}-sonar | |
| restore-keys: ${{ runner.os }}-sonar | |
| - name: Inject Google Services JSON | |
| env: | |
| FIREBASE_GOOGLE_SERVICES_JSON_DEBUG: ${{ secrets.FIREBASE_GOOGLE_SERVICES_JSON_DEBUG }} | |
| run: | | |
| mkdir -p androidApp/src/debug | |
| mkdir -p androidApp/src/release | |
| # If secret exists, use it. Otherwise fall back to dummy for PRs from forks. | |
| if [ -n "$FIREBASE_GOOGLE_SERVICES_JSON_DEBUG" ]; then | |
| echo "$FIREBASE_GOOGLE_SERVICES_JSON_DEBUG" | base64 -d > androidApp/src/debug/google-services.json | |
| echo "$FIREBASE_GOOGLE_SERVICES_JSON_DEBUG" | base64 -d > androidApp/src/release/google-services.json | |
| else | |
| echo "WARNING: FIREBASE_GOOGLE_SERVICES_JSON_DEBUG not found. Using dummy." | |
| echo '{ "project_info": {"project_number": "000000000000" }, "client": [{ "client_info": { "android_client_info": { "package_name": "app.lusk.underseerr.debug" } } }] }' > androidApp/src/debug/google-services.json | |
| echo '{ "project_info": {"project_number": "000000000000" }, "client": [{ "client_info": { "android_client_info": { "package_name": "app.lusk.underseerr" } } }] }' > androidApp/src/release/google-services.json | |
| fi | |
| - name: Build and analyze | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| CLOUDFLARE_WORKER_ENDPOINT_STAGING: ${{ secrets.CLOUDFLARE_WORKER_ENDPOINT_STAGING }} | |
| run: ./gradlew :androidApp:assembleDebug :composeApp:compileAndroidMain sonar --info |