Merge pull request #832 from ZeusWPI/dependabot/github_actions/action… #1238
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
name: CI | |
# We run the tests on master, development and for PR's. | |
on: [push] | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
command: [testOpenDebug, testOpenRelease, testStoreDebug, testStoreRelease] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: 'gradle' | |
- name: Test with Gradle | |
run: ./gradlew ${{ matrix.command }} | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: 'gradle' | |
- name: Lint with Gradle | |
run: ./gradlew lint | |
build: | |
needs: test | |
name: Build app | |
runs-on: ubuntu-latest | |
# Only run on master | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
cache: 'gradle' | |
- name: Set up secrets.properties | |
run: echo "$SECRETS_PROPERTIES" | base64 --decode > app/secrets.properties | |
env: | |
SECRETS_PROPERTIES: ${{ secrets.SECRETS_PROPERTIES }} | |
- name: Set up signging key | |
run: echo "$UPLOAD_KEY_BASE64" | base64 --decode > app/upload.keystore | |
env: | |
UPLOAD_KEY_BASE64: ${{ secrets.UPLOAD_KEY_BASE64 }} | |
- name: Build APK | |
run: ./gradlew assembleRelease | |
- name: Upload store APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hydra-store.apk | |
path: app/build/outputs/apk/store/release/app-store-release.apk | |
if-no-files-found: error | |
- name: Upload foss APK | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hydra-foss.apk | |
path: app/build/outputs/apk/open/release/app-open-release.apk | |
if-no-files-found: error | |
- name: Build App Bundle | |
run: ./gradlew bundleRelease | |
- name: Upload store bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hydra-store.aab | |
path: app/build/outputs/bundle/storeRelease/app-store-release.aab | |
if-no-files-found: error | |
- name: Upload foss bundle | |
uses: actions/upload-artifact@v3 | |
with: | |
name: hydra-foss.aab | |
path: app/build/outputs/bundle/openRelease/app-open-release.aab | |
if-no-files-found: error |