Skip to content

Create alerts on cell devices (#445) #391

Create alerts on cell devices (#445)

Create alerts on cell devices (#445) #391

name: Build Development - Distribute it on Firebase - Deploy Coverage Report
on:
push:
branches: [ main ]
env:
# Mapbox SDK secrets
ORG_GRADLE_PROJECT_MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
ORG_GRADLE_PROJECT_MAPBOX_DOWNLOADS_TOKEN: ${{ secrets.MAPBOX_DOWNLOADS_TOKEN }}
ORG_GRADLE_PROJECT_MAPBOX_STYLE: ${{ secrets.MAPBOX_STYLE }}
# Release key information
ORG_GRADLE_PROJECT_RELEASE_KEYSTORE: ${{ secrets.RELEASE_KEYSTORE }}
ORG_GRADLE_PROJECT_RELEASE_KEYSTORE_PASSWORD: ${{ secrets.RELEASE_KEYSTORE_PASSWORD }}
ORG_GRADLE_PROJECT_RELEASE_KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }}
ORG_GRADLE_PROJECT_RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
# Debug key information
ORG_GRADLE_PROJECT_DEBUG_KEYSTORE: ${{ secrets.DEBUG_KEYSTORE }}
ORG_GRADLE_PROJECT_DEBUG_KEYSTORE_PASSWORD: ${{ secrets.DEBUG_KEYSTORE_PASSWORD }}
ORG_GRADLE_PROJECT_DEBUG_KEY_ALIAS: ${{ secrets.DEBUG_KEY_ALIAS }}
ORG_GRADLE_PROJECT_DEBUG_KEY_PASSWORD: ${{ secrets.DEBUG_KEY_PASSWORD }}
# Firebase distribution on tech team group
ORG_GRADLE_PROJECT_FIREBASE_TEST_GROUP: ${{ secrets.FIREBASE_TECH_TEAM_TEST_GROUP }}
# Gradle config
GRADLE_USER_HOME: ${GITHUB_WORKSPACE}/.gradle
GLOBAL_GRADLE_CACHE: gradle-cache-${GITHUB_REPOSITORY}
jobs:
development_dist_and_coverage_report:
permissions:
contents: read
pages: write
id-token: write
environment: development
env:
# API URL for Dev Flavor
ORG_GRADLE_PROJECT_API_URL: ${{ secrets.API_URL }}
# Claim DApp URL
ORG_GRADLE_PROJECT_CLAIM_APP_URL: ${{ secrets.CLAIM_APP_URL }}
# Mixpanel Token
ORG_GRADLE_PROJECT_MIXPANEL_TOKEN: ${{ secrets.MIXPANEL_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Re-fetch all tags # WA: https://github.com/actions/checkout/issues/882
run: git fetch --tags --force origin
- name: Gradle package cache
uses: actions/cache@v4
with:
key: ${{ env.GLOBAL_GRADLE_CACHE }}
path: ${{ env.GRADLE_USER_HOME }}
- name: Decode secrets
run: |
echo "${{ secrets.ENCODED_GOOGLE_SERVICES }}" | base64 -d > ./app/google-services.json
echo "${{ secrets.ENCODED_SERVICE_ACCOUNT }}" | base64 -d > ./ci-service-account.json
echo "${{ secrets.ENCODED_RELEASE_KEYSTORE }}" > release-keystore.asc
echo "${{ secrets.ENCODED_DEBUG_KEYSTORE }}" > debug-keystore.asc
gpg -d --passphrase "${{ secrets.ENCODED_RELEASE_KEYSTORE_PASSPHRASE }}" --batch release-keystore.asc > ./${{ secrets.RELEASE_KEYSTORE }}
gpg -d --passphrase "${{ secrets.DEBUG_KEYSTORE_PASSWORD }}" --batch debug-keystore.asc > ./${{ secrets.DEBUG_KEYSTORE }}
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Build development release and distribute on Firebase
run: ./gradlew :app:assembleRemoteDevDebug :app:appDistributionUploadRemoteDevDebug -PSKIP_PRODUCTION_ENV
- name: Generate JaCoCo coverage report
run: ./gradlew :app:jacocoCoverageTestReport -PSKIP_PRODUCTION_ENV -PSKIP_TAGS_LOGGING
- name: Upload JaCoCo Coverage Report (HTML) to Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'app/build/reports/jacoco'
- name: Deploy JaCoCo Coverage Report (HTML) to GitHub Pages
uses: actions/deploy-pages@v4