2020-12-09 06:55:57 +00:00
|
|
|
name: CI
|
|
|
|
|
2021-03-08 12:15:22 +00:00
|
|
|
on:
|
2021-08-04 17:00:15 +00:00
|
|
|
workflow_dispatch:
|
2021-03-08 12:15:22 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-03-08 12:19:18 +00:00
|
|
|
- dev
|
2021-06-05 15:34:27 +00:00
|
|
|
- master
|
2022-07-01 21:08:44 +00:00
|
|
|
- release**
|
2021-08-02 13:29:39 +00:00
|
|
|
paths-ignore:
|
2022-02-04 10:13:10 +00:00
|
|
|
- 'README.md'
|
|
|
|
- 'doc/**'
|
2021-08-02 13:29:39 +00:00
|
|
|
- 'fastlane/**'
|
|
|
|
- 'assets/**'
|
|
|
|
- '.github/**/*.md'
|
2022-02-04 10:32:33 +00:00
|
|
|
- '.github/FUNDING.yml'
|
2022-02-12 19:34:08 +00:00
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
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
|
2021-08-02 13:29:39 +00:00
|
|
|
paths-ignore:
|
2022-02-04 10:13:10 +00:00
|
|
|
- 'README.md'
|
|
|
|
- 'doc/**'
|
2021-08-02 13:29:39 +00:00
|
|
|
- 'fastlane/**'
|
|
|
|
- 'assets/**'
|
|
|
|
- '.github/**/*.md'
|
2022-02-04 10:32:33 +00:00
|
|
|
- '.github/FUNDING.yml'
|
2022-02-12 19:34:08 +00:00
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
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
|
2022-07-03 17:38:51 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-12-09 06:55:57 +00:00
|
|
|
steps:
|
2022-04-14 19:43:56 +00:00
|
|
|
- uses: actions/checkout@v3
|
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-08-25 15:05:10 +00:00
|
|
|
- name: set up JDK 11
|
2022-04-14 19:43:56 +00:00
|
|
|
uses: actions/setup-java@v3
|
2020-12-09 06:55:57 +00:00
|
|
|
with:
|
2021-08-25 15:05:10 +00:00
|
|
|
java-version: 11
|
2021-08-27 13:21:48 +00:00
|
|
|
distribution: "temurin"
|
2021-08-28 13:22:04 +00:00
|
|
|
cache: 'gradle'
|
2021-12-20 15:29:20 +00:00
|
|
|
|
2021-01-06 15:32:33 +00:00
|
|
|
- name: Build debug APK and run jvm tests
|
2021-08-06 16:11:22 +00:00
|
|
|
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint
|
2020-12-09 06:55:57 +00:00
|
|
|
|
|
|
|
- name: Upload APK
|
2022-04-14 19:43:56 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-12-09 06:55:57 +00:00
|
|
|
with:
|
|
|
|
name: app
|
|
|
|
path: app/build/outputs/apk/debug/*.apk
|
2021-01-06 15:32:33 +00:00
|
|
|
|
2021-07-06 14:24:32 +00:00
|
|
|
test-android:
|
|
|
|
# macos has hardware acceleration. See android-emulator-runner action
|
|
|
|
runs-on: macos-latest
|
2022-01-21 21:15:34 +00:00
|
|
|
timeout-minutes: 20
|
2021-07-06 14:24:32 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-12-20 15:29:20 +00:00
|
|
|
# api-level 19 is min sdk, but throws errors related to desugaring
|
2021-07-20 16:28:46 +00:00
|
|
|
api-level: [ 21, 29 ]
|
2022-07-03 17:38:51 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-07-06 14:24:32 +00:00
|
|
|
steps:
|
2022-04-14 19:43:56 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-07-06 14:24:32 +00:00
|
|
|
|
2021-08-25 15:05:10 +00:00
|
|
|
- name: set up JDK 11
|
2022-04-14 19:43:56 +00:00
|
|
|
uses: actions/setup-java@v3
|
2021-07-06 14:24:32 +00:00
|
|
|
with:
|
2021-08-25 15:05:10 +00:00
|
|
|
java-version: 11
|
2021-08-27 13:21:48 +00:00
|
|
|
distribution: "temurin"
|
2021-08-28 13:22:04 +00:00
|
|
|
cache: 'gradle'
|
2021-07-06 14:24:32 +00:00
|
|
|
|
|
|
|
- name: Run android tests
|
|
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
|
|
with:
|
|
|
|
api-level: ${{ matrix.api-level }}
|
|
|
|
# workaround to emulator bug: https://github.com/ReactiveCircus/android-emulator-runner/issues/160
|
|
|
|
emulator-build: 7425822
|
2021-12-20 15:29:20 +00:00
|
|
|
script: ./gradlew connectedCheck --stacktrace
|
2022-07-03 17:38:51 +00:00
|
|
|
|
2022-01-09 17:09:47 +00:00
|
|
|
- name: Upload test report when tests fail # because the printed out stacktrace (console) is too short, see also #7553
|
2022-04-14 19:43:56 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-01-09 17:09:47 +00:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: android-test-report-api${{ matrix.api-level }}
|
|
|
|
path: app/build/reports/androidTests/connected/**
|
2021-01-06 15:32:33 +00:00
|
|
|
|
2021-12-19 11:18:37 +00:00
|
|
|
sonar:
|
|
|
|
runs-on: ubuntu-latest
|
2022-07-03 17:38:51 +00:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-12-19 11:18:37 +00:00
|
|
|
steps:
|
2022-04-14 19:43:56 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-12-19 11:18:37 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
2021-03-15 08:51:51 +00:00
|
|
|
|
2021-12-19 11:18:37 +00:00
|
|
|
- name: Set up JDK 11
|
2022-04-14 19:43:56 +00:00
|
|
|
uses: actions/setup-java@v3
|
2021-12-19 11:18:37 +00:00
|
|
|
with:
|
|
|
|
java-version: 11 # Sonar requires JDK 11
|
|
|
|
distribution: "temurin"
|
|
|
|
cache: 'gradle'
|
2021-03-15 08:51:51 +00:00
|
|
|
|
2021-12-19 11:18:37 +00:00
|
|
|
- name: Cache SonarCloud packages
|
2022-04-14 19:43:56 +00:00
|
|
|
uses: actions/cache@v3
|
2021-12-19 11:18:37 +00:00
|
|
|
with:
|
|
|
|
path: ~/.sonar/cache
|
|
|
|
key: ${{ runner.os }}-sonar
|
|
|
|
restore-keys: ${{ runner.os }}-sonar
|
2021-03-15 08:51:51 +00:00
|
|
|
|
2021-12-19 11:18:37 +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
|