Skip to content

Commit

Permalink
Merge pull request #1390 from minvws/feature/gradle-action
Browse files Browse the repository at this point in the history
Use the Gradle build action
  • Loading branch information
ktiniatros committed Oct 5, 2022
2 parents b60fced + 4c7b06c commit 12273b8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 42 deletions.
23 changes: 23 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Build setup'
description: 'Checks out the code and setups gradle'
runs:
using: "composite"
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
- name: Show java version
shell: bash
run: java -version
- name: Validate checksum gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: "Setup Gradle"
uses: gradle/gradle-build-action@v2
with:
# Cache results from main and release branches only per docs
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/release' }}
16 changes: 6 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
steps:
- uses: actions/checkout@v2
- id: setup
uses: ./scripts
uses: ./.github/actions/setup
- name: Spotless
run: ./gradlew spotlessCheck
- name: Test
run: ./gradlew testDebug testAccDebug lint
run: ./gradlew testDebug testAccDebug holder:lintAccDebug verifier:lintAccDebug
- name: Emulator Test
if: "!contains(github.event.pull_request.labels.*.name, 'skip-screenshot-tests')"
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -41,22 +41,23 @@ jobs:
path: test-results

distribute:
if: ${{ github.event.repository.name != 'nl-covid19-coronacheck-app-android' && ( github.ref == 'refs/heads/main' || contains(github.event.ref, 'release/') || contains(github.event.pull_request.labels.*.name, 'generate-builds')) }}
if: ${{ (github.event.repository.name == 'nl-covid19-coronacheck-app-android-private' && (github.ref == 'refs/heads/main' || contains(github.event.ref, 'release/') || contains(github.event.pull_request.labels.*.name, 'generate-builds'))) }}
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_URL }}
SLACK_MESSAGE: 'New apps available for android :green_heart:'
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
GENERATE_FDROID_BUILDS: ${{ github.event.repository.name != 'nl-covid19-coronacheck-app-android' && contains(github.event.pull_request.labels.*.name, 'generate-fdroid-builds') }}
GENERATE_FDROID_BUILDS: ${{ contains(github.event.pull_request.labels.*.name, 'generate-fdroid-builds') }}
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
runs-on: ubuntu-latest
needs: [ "build-and-test" ]

steps:
- uses: actions/checkout@v2
- id: setup
uses: ./scripts
uses: ./.github/actions/setup
- name: Build mobilecore.aar
if: github.repository_owner != 'minvws'
run: |
Expand All @@ -81,18 +82,13 @@ jobs:
cd ..
cp mobilecore-src/mobilecore.aar mobilecore/
- name: Write key store
if: github.event.repository.name != 'nl-covid19-coronacheck-app-android'
env:
KEYSTORE_FILE: ${{ secrets.KEYSTORE_FILE }}
run: echo $KEYSTORE_FILE | base64 --decode > keystore.jks
- name: Build
if: github.event.repository.name != 'nl-covid19-coronacheck-app-android'
run: ./gradlew assemTstRelease assemAccRelease assemProdRelease bundleProdRelease
- name: Build fdroid
if: ${{ env.GENERATE_FDROID_BUILDS == 'true' }}
run: /gradlew assemFdroidAccRelease
- name: Clean up key store
if: ${{github.event.repository.name != 'nl-covid19-coronacheck-app-android'}}
run: rm keystore.jks
- name: Archive apks
uses: actions/upload-artifact@v2
Expand Down
32 changes: 0 additions & 32 deletions scripts/action.yml

This file was deleted.

0 comments on commit 12273b8

Please sign in to comment.