Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Create Build.yml #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/BuildTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build and Test

on:
workflow_dispatch:

jobs:

local_test_job:
name: Running Local Tests
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Print Java version
run: javac -version
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Run Debug Tests
run: ./gradlew testDebugUnitTest --continue
- name: Upload Test Reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: test-reports
path: 'app/build/reports/tests/'

android_test_job:
name: Android Tests
runs-on: macos-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Print Java version
run: javac -version
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedAndroidTest

- name: Upload Android Test Reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: android-test-reports
path: 'app/build/reports/androidTests/'

build_job:
name: Building the APK
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore Cache
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Assemble Debug
run: ./gradlew assembleDebug

- name: Upload APK
uses: actions/upload-artifact@v2
with:
name: apk
path: app/build/outputs/apk/debug/**.apk