Merge branch 'feat/develop' #16
This file contains 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 Cloud | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build and analyze | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'zulu' # Alternative distribution options are available | |
- name: Set up Firebase | |
run: | | |
echo "{ | |
\"project_info\": { | |
\"project_number\": \"${{ secrets.FIREBASE_PROJECT_NUMBER }}\", | |
\"project_id\": \"${{ secrets.FIREBASE_PROJECT_ID }}\", | |
\"storage_bucket\": \"${{ secrets.FIREBASE_STORAGE_BUCKET }}\" | |
}, | |
\"client\": [ | |
{ | |
\"client_info\": { | |
\"mobilesdk_app_id\": \"${{ secrets.FIREBASE_APP_ID }}\", | |
\"android_client_info\": { | |
\"package_name\": \"com.example.lifeline\" | |
} | |
}, | |
\"api_key\": [ | |
{ | |
\"current_key\": \"${{ secrets.FIREBASE_API_KEY }}\" | |
} | |
] | |
} | |
], | |
\"configuration_version\": \"1\" | |
}" > $GITHUB_WORKSPACE/LifeLine/app/google-services.json | |
- name: Cache SonarQube Cloud packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache Gradle packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | |
restore-keys: ${{ runner.os }}-gradle | |
- name: Make gradlew executable | |
run: | | |
cd LifeLine | |
chmod +x ./gradlew | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
sonar.androidLint.reportPaths: $GITHUB_WORKSPACE/LifeLine/app/build/reports/lint-results-debug.html,$GITHUB_WORKSPACE/LifeLine/app/build/reports/lint-results-debug.txt,$GITHUB_WORKSPACE/LifeLine/app/build/reports/lint-results-debug.xml | |
run: | | |
cd LifeLine | |
./gradlew build sonar --info |