Scenario blockchain #347
Workflow file for this run
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
# Build and test the android application | |
name: Android | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./android | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of Sonar analysis | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
- name: Cache Gradle | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
- name: Grant execute permission for gradlew | |
run: | | |
chmod +x ./gradlew | |
- name: Build App | |
shell: bash | |
run: | | |
# To run the CI with debug informations, add --info | |
./gradlew assemble lint --parallel --build-cache | |
- name: Run tests | |
shell: bash | |
run: | | |
# To run the CI with debug informations, add --info | |
./gradlew check --parallel --build-cache | |
- name: Generate Coverage Report | |
shell: bash | |
run: | | |
# To run the CI with debug informations, use --info | |
./gradlew jacocoTestReport --parallel --build-cache | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v2 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: SonarCloud Analysis | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_ANDROID}} | |
run: | | |
# To run the CI with debug informations, use --info | |
./gradlew sonarqube --parallel --build-cache | |
- uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: reports | |
path: ./android/app/build/reports |