2020-12-27 11:30:50 -06:00
|
|
|
name: Test and deploy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ develop ]
|
|
|
|
tags: [ '*' ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ develop ]
|
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
unit-tests:
|
|
|
|
name: Unit tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
2021-03-06 08:34:07 -06:00
|
|
|
- uses: fkirc/skip-duplicate-actions@master
|
2020-12-27 11:30:50 -06:00
|
|
|
- uses: actions/checkout@v2
|
2021-03-06 08:34:07 -06:00
|
|
|
- uses: gradle/wrapper-validation-action@v1
|
2020-12-27 11:30:50 -06:00
|
|
|
- uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 11
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
|
|
|
|
- name: Unit tests
|
|
|
|
run: |
|
2020-12-28 15:45:21 -06:00
|
|
|
./gradlew --build-cache -Pcoverage testFdroidDebugUnitTest --stacktrace
|
|
|
|
./gradlew --build-cache -Pcoverage jacocoTestReport --stacktrace
|
2020-12-27 11:30:50 -06:00
|
|
|
- uses: codecov/codecov-action@v1
|
|
|
|
with:
|
|
|
|
flags: unit
|
|
|
|
|
|
|
|
deploy-google-play:
|
|
|
|
name: Deploy to google play
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
environment: google-play
|
2021-03-06 08:34:07 -06:00
|
|
|
needs: [ unit-tests ]
|
2020-12-27 11:30:50 -06:00
|
|
|
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 11
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.gradle/caches
|
|
|
|
~/.gradle/wrapper
|
|
|
|
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
|
|
|
|
- name: Decrypt keys
|
|
|
|
env:
|
|
|
|
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}
|
|
|
|
SERVICES_ENCRYPT_KEY: ${{ secrets.SERVICES_ENCRYPT_KEY }}
|
|
|
|
run: |
|
|
|
|
gpg --yes --batch --passphrase=$SERVICES_ENCRYPT_KEY ./app/src/release/google-services.json.gpg
|
|
|
|
gpg --yes --batch --passphrase=$ENCRYPT_KEY ./app/key.p12.gpg
|
|
|
|
gpg --yes --batch --passphrase=$ENCRYPT_KEY ./app/upload-key.jks.gpg
|
|
|
|
- name: Upload apk to google play
|
|
|
|
env:
|
2021-01-21 03:24:38 -06:00
|
|
|
PLAY_KEY_ALIAS: ${{ secrets.PLAY_KEY_ALIAS }}
|
2020-12-27 11:30:50 -06:00
|
|
|
PLAY_KEY_PASSWORD: ${{ secrets.PLAY_KEY_PASSWORD }}
|
|
|
|
PLAY_SERVICE_ACCOUNT_EMAIL: ${{ secrets.PLAY_SERVICE_ACCOUNT_EMAIL }}
|
|
|
|
PLAY_STORE_PASSWORD: ${{ secrets.PLAY_STORE_PASSWORD }}
|
|
|
|
run: ./gradlew publishPlayRelease -PenableFirebase --stacktrace;
|