2020-12-09 06:55:57 +00:00
|
|
|
name: CI
|
|
|
|
|
2021-03-08 12:15:22 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-03-08 12:19:18 +00:00
|
|
|
- dev
|
2021-06-05 15:34:27 +00:00
|
|
|
- master
|
2021-03-08 12:15:22 +00:00
|
|
|
push:
|
2021-03-21 01:47:19 +00:00
|
|
|
branches:
|
2021-03-08 12:19:18 +00:00
|
|
|
- dev
|
2021-03-09 10:21:40 +00:00
|
|
|
- master
|
2020-12-09 06:55:57 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-01-06 15:32:33 +00:00
|
|
|
build-and-test-jvm:
|
2020-12-09 06:55:57 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2021-03-21 01:47:19 +00:00
|
|
|
- uses: gradle/wrapper-validation-action@v1
|
2020-12-09 06:55:57 +00:00
|
|
|
|
2021-01-13 15:18:19 +00:00
|
|
|
- name: create and checkout branch
|
|
|
|
# push events already checked out the branch
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: git checkout -B ${{ github.head_ref }}
|
|
|
|
|
2021-04-14 15:13:05 +00:00
|
|
|
- name: set up JDK 8
|
|
|
|
uses: actions/setup-java@v2
|
2020-12-09 06:55:57 +00:00
|
|
|
with:
|
2021-04-14 15:13:05 +00:00
|
|
|
java-version: 8
|
2021-05-23 12:54:49 +00:00
|
|
|
distribution: "adopt"
|
2020-12-09 06:55:57 +00:00
|
|
|
|
|
|
|
- name: Cache Gradle dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle
|
|
|
|
|
2021-01-06 15:32:33 +00:00
|
|
|
- name: Build debug APK and run jvm tests
|
2020-12-09 06:55:57 +00:00
|
|
|
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace
|
|
|
|
|
|
|
|
- name: Upload APK
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: app
|
|
|
|
path: app/build/outputs/apk/debug/*.apk
|
2021-01-06 15:32:33 +00:00
|
|
|
test-android:
|
|
|
|
runs-on: macos-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
api-level: [21, 29]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2021-04-14 15:13:05 +00:00
|
|
|
- name: set up JDK 8
|
|
|
|
uses: actions/setup-java@v2
|
2021-01-06 15:32:33 +00:00
|
|
|
with:
|
2021-04-14 15:13:05 +00:00
|
|
|
java-version: 8
|
2021-05-23 12:54:49 +00:00
|
|
|
distribution: "adopt"
|
2021-01-06 15:32:33 +00:00
|
|
|
|
|
|
|
- name: Cache Gradle dependencies
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
restore-keys: ${{ runner.os }}-gradle
|
|
|
|
|
|
|
|
- name: Run android tests
|
|
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
|
|
with:
|
|
|
|
api-level: ${{ matrix.api-level }}
|
|
|
|
script: ./gradlew connectedCheck
|
2021-03-24 18:10:00 +00:00
|
|
|
# sonar:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# with:
|
|
|
|
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
2021-03-15 08:51:51 +00:00
|
|
|
|
2021-03-24 18:10:00 +00:00
|
|
|
# - name: Set up JDK 11
|
2021-04-14 15:13:05 +00:00
|
|
|
# uses: actions/setup-java@v2
|
2021-03-24 18:10:00 +00:00
|
|
|
# with:
|
|
|
|
# java-version: 11 # Sonar requires JDK 11
|
2021-05-23 12:54:49 +00:00
|
|
|
# distribution: "adopt"
|
2021-03-15 08:51:51 +00:00
|
|
|
|
2021-03-24 18:10:00 +00:00
|
|
|
# - name: Cache SonarCloud packages
|
|
|
|
# uses: actions/cache@v2
|
|
|
|
# with:
|
|
|
|
# path: ~/.sonar/cache
|
|
|
|
# key: ${{ runner.os }}-sonar
|
|
|
|
# restore-keys: ${{ runner.os }}-sonar
|
2021-03-15 08:51:51 +00:00
|
|
|
|
2021-03-24 18:10:00 +00:00
|
|
|
# - name: Cache Gradle packages
|
|
|
|
# uses: actions/cache@v2
|
|
|
|
# with:
|
|
|
|
# path: ~/.gradle/caches
|
|
|
|
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
# restore-keys: ${{ runner.os }}-gradle
|
2021-03-15 08:51:51 +00:00
|
|
|
|
2021-03-24 18:10:00 +00:00
|
|
|
# - name: Build and analyze
|
|
|
|
# env:
|
|
|
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
|
|
|
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
# run: ./gradlew build sonarqube --info
|