2020-12-09 07:55:57 +01:00
|
|
|
name: CI
|
|
|
|
|
2021-03-08 13:15:22 +01:00
|
|
|
on:
|
2021-08-04 19:00:15 +02:00
|
|
|
workflow_dispatch:
|
2021-03-08 13:15:22 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2021-03-08 13:19:18 +01:00
|
|
|
- dev
|
2021-06-05 17:34:27 +02:00
|
|
|
- master
|
2022-07-01 23:08:44 +02:00
|
|
|
- release**
|
2021-08-02 15:29:39 +02:00
|
|
|
paths-ignore:
|
2022-02-04 11:13:10 +01:00
|
|
|
- 'README.md'
|
|
|
|
- 'doc/**'
|
2021-08-02 15:29:39 +02:00
|
|
|
- 'fastlane/**'
|
|
|
|
- 'assets/**'
|
|
|
|
- '.github/**/*.md'
|
2022-02-04 11:32:33 +01:00
|
|
|
- '.github/FUNDING.yml'
|
2022-02-12 20:34:08 +01:00
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
2021-03-08 13:15:22 +01:00
|
|
|
push:
|
2021-03-21 02:47:19 +01:00
|
|
|
branches:
|
2021-03-08 13:19:18 +01:00
|
|
|
- dev
|
2021-03-09 11:21:40 +01:00
|
|
|
- master
|
2021-08-02 15:29:39 +02:00
|
|
|
paths-ignore:
|
2022-02-04 11:13:10 +01:00
|
|
|
- 'README.md'
|
|
|
|
- 'doc/**'
|
2021-08-02 15:29:39 +02:00
|
|
|
- 'fastlane/**'
|
|
|
|
- 'assets/**'
|
|
|
|
- '.github/**/*.md'
|
2022-02-04 11:32:33 +01:00
|
|
|
- '.github/FUNDING.yml'
|
2022-02-12 20:34:08 +01:00
|
|
|
- '.github/ISSUE_TEMPLATE/**'
|
2020-12-09 07:55:57 +01:00
|
|
|
|
|
|
|
jobs:
|
2021-01-06 16:32:33 +01:00
|
|
|
build-and-test-jvm:
|
2020-12-09 07:55:57 +01:00
|
|
|
runs-on: ubuntu-latest
|
2022-07-03 19:38:51 +02:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-12-09 07:55:57 +01:00
|
|
|
steps:
|
2024-01-08 04:55:57 +01:00
|
|
|
- uses: actions/checkout@v4
|
2021-03-21 02:47:19 +01:00
|
|
|
- uses: gradle/wrapper-validation-action@v1
|
2020-12-09 07:55:57 +01:00
|
|
|
|
2021-01-13 16:18:19 +01:00
|
|
|
- name: create and checkout branch
|
|
|
|
# push events already checked out the branch
|
|
|
|
if: github.event_name == 'pull_request'
|
2023-04-26 16:01:20 +02:00
|
|
|
env:
|
|
|
|
BRANCH: ${{ github.head_ref }}
|
|
|
|
run: git checkout -B "$BRANCH"
|
2021-01-13 16:18:19 +01:00
|
|
|
|
2023-04-20 11:31:45 +02:00
|
|
|
- name: set up JDK 17
|
2024-01-08 04:55:57 +01:00
|
|
|
uses: actions/setup-java@v4
|
2020-12-09 07:55:57 +01:00
|
|
|
with:
|
2023-04-20 11:31:45 +02:00
|
|
|
java-version: 17
|
2021-08-27 15:21:48 +02:00
|
|
|
distribution: "temurin"
|
2021-08-28 15:22:04 +02:00
|
|
|
cache: 'gradle'
|
2021-12-20 16:29:20 +01:00
|
|
|
|
2021-01-06 16:32:33 +01:00
|
|
|
- name: Build debug APK and run jvm tests
|
2021-08-06 18:11:22 +02:00
|
|
|
run: ./gradlew assembleDebug lintDebug testDebugUnitTest --stacktrace -DskipFormatKtlint
|
2020-12-09 07:55:57 +01:00
|
|
|
|
|
|
|
- name: Upload APK
|
2024-01-08 04:55:57 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-12-09 07:55:57 +01:00
|
|
|
with:
|
|
|
|
name: app
|
|
|
|
path: app/build/outputs/apk/debug/*.apk
|
2021-01-06 16:32:33 +01:00
|
|
|
|
2021-07-06 16:24:32 +02:00
|
|
|
test-android:
|
|
|
|
# macos has hardware acceleration. See android-emulator-runner action
|
|
|
|
runs-on: macos-latest
|
2022-01-21 22:15:34 +01:00
|
|
|
timeout-minutes: 20
|
2021-07-06 16:24:32 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-04-20 11:31:45 +02:00
|
|
|
include:
|
|
|
|
- api-level: 21
|
|
|
|
target: default
|
|
|
|
arch: x86
|
|
|
|
- api-level: 33
|
|
|
|
target: google_apis # emulator API 33 only exists with Google APIs
|
|
|
|
arch: x86_64
|
2022-07-03 19:38:51 +02:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-07-06 16:24:32 +02:00
|
|
|
steps:
|
2024-01-08 04:55:57 +01:00
|
|
|
- uses: actions/checkout@v4
|
2021-07-06 16:24:32 +02:00
|
|
|
|
2023-04-20 11:31:45 +02:00
|
|
|
- name: set up JDK 17
|
2024-01-08 04:55:57 +01:00
|
|
|
uses: actions/setup-java@v4
|
2021-07-06 16:24:32 +02:00
|
|
|
with:
|
2023-04-20 11:31:45 +02:00
|
|
|
java-version: 17
|
2021-08-27 15:21:48 +02:00
|
|
|
distribution: "temurin"
|
2021-08-28 15:22:04 +02:00
|
|
|
cache: 'gradle'
|
2021-07-06 16:24:32 +02:00
|
|
|
|
|
|
|
- name: Run android tests
|
|
|
|
uses: reactivecircus/android-emulator-runner@v2
|
|
|
|
with:
|
|
|
|
api-level: ${{ matrix.api-level }}
|
2023-04-20 11:31:45 +02:00
|
|
|
target: ${{ matrix.target }}
|
|
|
|
arch: ${{ matrix.arch }}
|
2021-12-20 16:29:20 +01:00
|
|
|
script: ./gradlew connectedCheck --stacktrace
|
2022-07-03 19:38:51 +02:00
|
|
|
|
2022-01-09 18:09:47 +01:00
|
|
|
- name: Upload test report when tests fail # because the printed out stacktrace (console) is too short, see also #7553
|
2024-01-08 04:55:57 +01:00
|
|
|
uses: actions/upload-artifact@v4
|
2022-01-09 18:09:47 +01:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: android-test-report-api${{ matrix.api-level }}
|
|
|
|
path: app/build/reports/androidTests/connected/**
|
2021-01-06 16:32:33 +01:00
|
|
|
|
2021-12-19 12:18:37 +01:00
|
|
|
sonar:
|
|
|
|
runs-on: ubuntu-latest
|
2022-07-03 19:38:51 +02:00
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-12-19 12:18:37 +01:00
|
|
|
steps:
|
2024-01-08 04:55:57 +01:00
|
|
|
- uses: actions/checkout@v4
|
2021-12-19 12:18:37 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
2021-03-15 09:51:51 +01:00
|
|
|
|
2023-04-20 11:31:45 +02:00
|
|
|
- name: Set up JDK 17
|
2024-01-08 04:55:57 +01:00
|
|
|
uses: actions/setup-java@v4
|
2021-12-19 12:18:37 +01:00
|
|
|
with:
|
2023-04-20 11:31:45 +02:00
|
|
|
java-version: 17
|
2021-12-19 12:18:37 +01:00
|
|
|
distribution: "temurin"
|
|
|
|
cache: 'gradle'
|
2021-03-15 09:51:51 +01:00
|
|
|
|
2021-12-19 12:18:37 +01:00
|
|
|
- name: Cache SonarCloud packages
|
2022-04-14 21:43:56 +02:00
|
|
|
uses: actions/cache@v3
|
2021-12-19 12:18:37 +01:00
|
|
|
with:
|
|
|
|
path: ~/.sonar/cache
|
|
|
|
key: ${{ runner.os }}-sonar
|
|
|
|
restore-keys: ${{ runner.os }}-sonar
|
2021-03-15 09:51:51 +01:00
|
|
|
|
2021-12-19 12:18:37 +01:00
|
|
|
- name: Build and analyze
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
|
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
2022-11-29 17:20:31 +01:00
|
|
|
run: ./gradlew build sonar --info
|