Feature/fe 1360 analytics for photo verification feature #519
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
# This is a basic workflow to help you get started with Actions | |
name: Build & Code Analysis & Unit Tests & Coverage | |
# Controls when the workflow will run | |
on: | |
pull_request | |
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 }} | |
# 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: | |
build: | |
environment: production | |
permissions: | |
pull-requests: write | |
env: | |
# API URL for Prod 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_RELEASE_KEYSTORE }}" > release-keystore.asc | |
gpg -d --passphrase "${{ secrets.ENCODED_RELEASE_KEYSTORE_PASSPHRASE }}" --batch release-keystore.asc > ./${{ secrets.RELEASE_KEYSTORE }} | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Build Production | |
run: ./gradlew :app:assembleRemoteProdRelease -PSKIP_PRODUCTION_ENV | |
- name: Build Local Mock | |
run: ./gradlew :app:assemblelocalMockDebug -PSKIP_PRODUCTION_ENV | |
codeanalysis: | |
needs: build | |
environment: production | |
env: | |
# API URL for Prod 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: 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 | |
gpg -d --passphrase "${{ secrets.ENCODED_RELEASE_KEYSTORE_PASSPHRASE }}" --batch release-keystore.asc > ./${{ secrets.RELEASE_KEYSTORE }} | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Detekt | |
run: ./gradlew :app:detekt -PSKIP_PRODUCTION_ENV | |
unit-tests: | |
needs: build | |
environment: production | |
env: | |
# API URL for Prod 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: 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 | |
gpg -d --passphrase "${{ secrets.ENCODED_RELEASE_KEYSTORE_PASSPHRASE }}" --batch release-keystore.asc > ./${{ secrets.RELEASE_KEYSTORE }} | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Run Unit Tests | |
run: ./gradlew :app:testRemoteProdDebugUnitTest -PSKIP_PRODUCTION_ENV -PSKIP_TAGS_LOGGING | |
- name: Create Test Report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() # run this step even if previous step failed | |
with: | |
name: Test Report | |
path: app/build/test-results/testRemoteProdDebugUnitTest/*.xml | |
only-summary: true | |
reporter: java-junit | |
coverage: | |
needs: unit-tests | |
environment: production | |
env: | |
# API URL for Prod 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: 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 | |
gpg -d --passphrase "${{ secrets.ENCODED_RELEASE_KEYSTORE_PASSPHRASE }}" --batch release-keystore.asc > ./${{ secrets.RELEASE_KEYSTORE }} | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Generate JaCoCo coverage report | |
run: ./gradlew :app:jacocoCoverageTestReport -PSKIP_PRODUCTION_ENV -PSKIP_TAGS_LOGGING | |
- name: Add JaCoCo coverage report in the PR as a comment | |
uses: madrapps/[email protected] | |
with: | |
title: '# Coverage Report (Type: [Instructions](https://www.jacoco.org/jacoco/trunk/doc/counters.html))' | |
paths: app/build/reports/jacoco/report.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
pass-emoji: ✅ | |
min-coverage-overall: 0 # TODO: Define this | |
min-coverage-changed-files: 0 # TODO: Define this | |
update-comment: true |