Restore buildability #333 #191
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
# credit: https://habr.com/ru/post/488134/ | |
name: Android CI | |
on: | |
push: | |
branches: | |
- master | |
- dev | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build-and-test: # instrumental tests run on MacOS to enable hardware acceleration | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.8 | |
- name: grant permissions to gradlew | |
run: chmod +x gradlew | |
- name: Build with Gradle | |
run: ./gradlew assembleDebug | |
- name: Run unit tests | |
run: ./gradlew test | |
- name: Run instrumental tests | |
# warning: it depends on "grant permission to gradlew" step | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 29 | |
script: ./gradlew connectedCheck | |
- name: Generate documentation | |
run: ./gradlew dokka | |
- name: Upload APK to artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: learn-braille-debug | |
path: app/build/outputs/apk/debug/app-debug.apk | |
- name: Upload documentation to artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: documentation-html | |
path: app/build/dokka/ | |
- name: Upload artifact (test reports) | |
uses: actions/upload-artifact@v1 | |
with: | |
name: test-reports | |
path: app/build/reports/ | |
if: success() || failure() | |
static-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up detekt # detekt gradle plugin uses newer gradle version than is used | |
run: curl -sSLO https://github.com/detekt/detekt/releases/download/v1.12.0-RC1/detekt && chmod a+x detekt | |
- name: Static check with detekt | |
run: ./detekt -c detekt-config.yml --build-upon-default-config | |
- name: Check not using developer's course | |
run: grep UsersCourse app/src/main/java/com/github/braillesystems/learnbraille/LearnBrailleApplication.kt |