Skip to content

Merge pull request #2 from sokoloff06/sonar #34

Merge pull request #2 from sokoloff06/sonar

Merge pull request #2 from sokoloff06/sonar #34

Workflow file for this run

name: Android CI
on:
push:
branches: [ "main", "sonar" ]
jobs:
build:
runs-on: ubuntu-latest
permissions: read-all
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Create google-services
env:
DATA: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $DATA > /home/runner/work/com.google.firebaseengage/com.google.firebaseengage/app/google-services.json
- name: Create secrets props
env:
DATA: ${{ secrets.SECRETS_BASE64 }}
run: |
echo $DATA | base64 -di > /home/runner/work/com.google.firebaseengage/com.google.firebaseengage/secrets.properties
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.SOKOLOVV_KEYSTORE_FILE_BASE64 }}
run: echo $ENCODED_STRING | base64 -di > /home/runner/work/com.google.firebaseengage/com.google.firebaseengage/sokolovv-keystore
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew build sonar --info
- name: Build with Gradle
run: ./gradlew build