Skip to content

Commit

Permalink
Merge pull request #741 from splendo/release/1.3.0
Browse files Browse the repository at this point in the history
Release 1.3.0
  • Loading branch information
Daeda88 authored Nov 9, 2023
2 parents 778b690 + b452a95 commit fff17e8
Show file tree
Hide file tree
Showing 649 changed files with 14,722 additions and 8,426 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ root = true

[*.{kt,kts}]
max_line_length = 180
ktlint_code_style = ktlint_official
ktlint_code_style = intellij_idea
ktlint_ignore_back_ticked_identifier = true

ktlint_standard = enabled
ktlint_standard_no-wildcard-imports = disabled
ktlint_standard_filename = disabled
ktlint_standard_import-ordering = disabled
ktlint_standard_function-naming = disabled

ktlint_experimental = disabled

26 changes: 26 additions & 0 deletions .github/workflows/android.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Android tests
on: pull_request
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17

- name: run Android unit tests
run: ./gradlew testDebugUnitTest

- name: run apiCheck
run: ./gradlew apiCheck
157 changes: 62 additions & 95 deletions .github/workflows/emulator.yaml
Original file line number Diff line number Diff line change
@@ -1,106 +1,52 @@
#### for keeping up to date with settings.gradle.kts see instructions in `test:` job
name: Android Emulator tests
on: pull_request
on:
pull_request:
workflow_dispatch:
inputs:
project:
description: 'Project (Gradle module) to run tests for'
required: false
type: string
video:
description: 'Record video'
required: false
type: boolean

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL: 120

jobs:
build:
runs-on: macos-12
steps:
- name: checkout
uses: actions/checkout@v3

# remove VM settings as defined for using the IDE
- run: sed -i '' -e '/org.gradle.jvmargs/d' gradle.properties; cat gradle.properties

- name : set up JDK 17
uses : actions/setup-java@v3
with :
distribution : 'temurin'
java-version : 17

- name: Gradle cache
uses: gradle/gradle-build-action@v2
with:
cache-read-only: false
gradle-home-cache-includes: |
caches
notifications
configuration-cache
- name: Konan cache
uses: actions/cache@v3
id: konan-cache
with:
path: ~/.konan/*
key: konan

- name: Make cache of workspace
uses: actions/cache@v3
id: restore-build
with:
path: |
./*
!/.gradle
key: build-${{ github.sha }}

- run: ./gradlew --parallel bundleLibRuntimeToJarDebug
uses: ./.github/workflows/setup_macos.yaml
with:
gradleTask: bundleLibRuntimeToJarDebug
project: ${{ inputs.project }}
projectBlacklist: hud

test:
needs: build
runs-on: macos-12
runs-on: macos-13
strategy:
fail-fast: false
matrix:
api-level: [23, 33]
# some custom gradle magic makes tests run grouped for `$module-*` and `*-$module` on CI so there is no need to add these to the matrix
module: [
"base",
"beacons",
"bluetooth",
"architecture",
"alerts",
"date-time",
"logging",
"hud",
"permissions",
"location",
"keyboard",
"media",
"links",
"resources",
"review",
"scientific",
"service",
"system",
"test-utils"
]
project: ${{ fromJSON(needs.build.outputs.projects) }}
steps:
- name: Gradle cache
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-includes: |
caches
notifications
configuration-cache
- name: Get cache of workspace
uses: actions/cache@v3
id: restore-build
- name: checkout
uses: actions/checkout@v3
with:
path: |
./*
!/.gradle
key: build-${{ github.sha }}
submodules: recursive

- name: set up JDK 17
uses: actions/setup-java@v3
- name: Setup tools and cache for workspace
uses: ./.github/workflows/setup_tools_macos/
with:
distribution: 'temurin'
java-version: 17
kotlinVersion: ${{ needs.build.outputs.kotlinVersion }}

- name: AVD cache
uses: actions/cache@v3
Expand All @@ -109,14 +55,7 @@ jobs:
path: |
~/.android/avd/*
~/.android/adb*
key: avd.v3-${{ matrix.api-level }}

- name: Konan cache
uses: actions/cache@v3
id: konan-cache
with:
path: ~/.konan/*
key: konan
key: avd.v11-${{ matrix.api-level }}

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
Expand All @@ -131,18 +70,46 @@ jobs:
disk-size: 3G
ram-size: 3G
heap-size: 1500M
script: echo "Generated AVD snapshot for caching."
profile: 3.4in WQVGA
channel: canary
cores: 6
script: ./script/check_emulator.sh

- name: install ffmpeg
if: inputs.video
uses: FedericoCarboni/setup-ffmpeg@v2

- name: pregenerate test package
if: inputs.video
run: ./gradlew :${{ matrix.project }}:packageDebugAndroidTest

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: google_apis
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot-save -noaudio -no-boot-anim -camera-back none
disable-animations: true
arch: x86_64
disk-size: 3G
ram-size: 3G
heap-size: 1500M
script: ./gradlew --parallel :${{ matrix.module }}:connectedDebugAndroidTest
profile: 3.4in WQVGA
channel: canary
cores: 6
script: |
./script/check_emulator.sh
./gradlew ${{ inputs.video && 'recordAndroid' }} :${{ matrix.project }}:connectedDebugAndroidTest
- name: rename video
if: always() && inputs.video
run: mv build/video.mp4 recording-${{ matrix.project }}-${{ matrix.api-level }}.mp4

- name: upload video
if: always() && inputs.video
continue-on-error: true
uses: actions/upload-artifact@master
with:
name: recording-${{ matrix.project }}-${{ matrix.api-level }}
path: recording-${{ matrix.project }}-${{ matrix.api-level }}.mp4
54 changes: 54 additions & 0 deletions .github/workflows/ios.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: iOS tests
on: pull_request
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=\"-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false\" -Dorg.gradle.daemon=false -Dkotlin.incremental=false -Dkotlin.daemon.jvm.options=-Xmx8G,-XX:MaxMetaspaceSize=512m,-Dorg.gradle.daemon=false,-Dkotlin.incremental=false"
JAVA_OPTS: "-Xmx8G -XX:MaxMetaspaceSize=512m -Dorg.gradle.daemon=false -Dkotlin.incremental=false"

jobs:
build:
uses: ./.github/workflows/setup_macos.yaml
with:
gradleTask: compileKotlinIosX64

lint:
needs: build
runs-on: macos-13
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup tools and cache for workspace
uses: ./.github/workflows/setup_tools_macos/
with:
kotlinVersion: ${{ needs.build.outputs.kotlinVersion }}

- name: ktLint
run: ./gradlew lintKotlin

- name: ktLint report
uses: actions/upload-artifact@v3
with:
name: ktLint report
path: build/reports/ktlint
if: ${{ failure() }}

test:
needs: build
runs-on: macos-13
strategy:
fail-fast: false
matrix:
module: ${{ fromJSON(needs.build.outputs.projects) }}
steps:
- name: checkout
uses: actions/checkout@v3

- name: Setup tools and cache for workspace
uses: ./.github/workflows/setup_tools_macos/
with:
kotlinVersion: ${{ needs.build.outputs.kotlinVersion }}

- name: run iOS tests
run: ./gradlew :${{ matrix.module }}:iosX64Test
9 changes: 7 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,19 @@ jobs:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
runs-on: macos-12
runs-on: macos-13
steps:
- name: checkout
uses: actions/checkout@v3
with:
submodules: recursive


# remove VM settings as defined for using the IDE
- run: sed -i '' -e '/org.gradle.jvmargs/d' gradle.properties; cat gradle.properties

# TODO: use setup_tools_macos

- name : set up JDK 17
uses : actions/setup-java@v3
with :
Expand All @@ -44,4 +49,4 @@ jobs:
if: ${{ github.ref_name == 'master' }}
env:
MAVEN_CENTRAL_RELEASE: "true"
run: ./gradlew publishAllPublicationsToSonatypeRepository --stacktrace
run: ./gradlew publishAllPublicationsToSonatypeRepository --stacktrace
13 changes: 13 additions & 0 deletions .github/workflows/rerun_emulator.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Rerun failed emulator tests
on:
workflow_run:
workflows: ["Android Emulator tests"]
types:
- completed

jobs:
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt < 2 }}
steps:
- run: gh run rerun ${{ github.event.workflow_run.id }} --failed
Loading

0 comments on commit fff17e8

Please sign in to comment.