Skip to content

Commit 0318d87

Browse files
authored
Modernize repo (#471)
1 parent 08a8fc3 commit 0318d87

File tree

202 files changed

+2424
-2492
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+2424
-2492
lines changed

.github/workflows/ci.yml

Lines changed: 66 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,85 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on:
4+
# Only run push on main
5+
push:
6+
branches:
7+
- main
8+
paths-ignore:
9+
- '**/*.md'
10+
# Always run on PRs
11+
pull_request:
12+
branches: [ main ]
13+
merge_group:
14+
15+
concurrency:
16+
group: 'ci-${{ github.event.merge_group.head_ref || github.head_ref }}-${{ github.workflow }}'
17+
cancel-in-progress: true
418

519
jobs:
620
build:
7-
name: JDK ${{ matrix.java_version }}
821
runs-on: macOS-latest
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
java_version: [11]
22+
env:
23+
api-level: "18"
1324
steps:
1425
- name: Checkout
1526
uses: actions/checkout@v1
27+
1628
- name: Gradle Wrapper Validation
1729
uses: gradle/wrapper-validation-action@v1
18-
- name: Install JDK ${{ matrix.java_version }}
30+
31+
- name: Install JDK
1932
uses: actions/setup-java@v2
2033
with:
2134
distribution: 'zulu'
22-
java-version: ${{ matrix.java_version }}
23-
- name: Install Android SDK
24-
uses: malinskiy/action-android/install-sdk@release/0.1.2
25-
- run: sdkmanager platform-tools
26-
# TODO Caching disabled for now due to the size of Gradle's cache rendering this super slow
27-
# - name: Cache build .gradle dir
28-
# uses: actions/[email protected]
29-
# with:
30-
# path: .gradle
31-
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
32-
# restore-keys: |
33-
# ${{ runner.os }}-gradle-
34-
# - name: Cache user .gradle dir
35-
# uses: actions/[email protected]
36-
# with:
37-
# path: ~/.gradle
38-
# key: ${{ runner.os }}-gradleuser-${{ hashFiles('**/*.gradle') }}
39-
# restore-keys: |
40-
# ${{ runner.os }}-gradleuser-
41-
- name: Configure Gradle
42-
# Initial gradle configuration, install dependencies, etc
43-
run: ./gradlew help
44-
- name: Spot check
45-
# Run spotless first to fail fast on spotless issues
46-
run: ./gradlew spotlessCheck --stacktrace
47-
- name: Build project
48-
run: ./gradlew assemble --stacktrace
35+
java-version: '17'
36+
37+
- name: Gradle cache
38+
uses: gradle/gradle-build-action@v2
39+
4940
# TODO split test and instrumentation into parallel builds
50-
- name: Run tests
51-
run: ./gradlew test --stacktrace
41+
- name: Build and run unit tests
42+
id: gradle
43+
uses: gradle/gradle-build-action@v2
44+
with:
45+
arguments: check
46+
47+
- name: AVD cache
48+
uses: actions/cache@v3
49+
id: avd-cache
50+
with:
51+
path: |
52+
~/.android/avd/*
53+
~/.android/adb*
54+
key: avd-${{ env.api-level }}
55+
56+
- name: Create AVD and generate snapshot for caching
57+
if: steps.avd-cache.outputs.cache-hit != 'true'
58+
uses: reactivecircus/android-emulator-runner@v2
59+
with:
60+
api-level: ${{ env.api-level }}
61+
force-avd-creation: false
62+
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
63+
disable-animations: false
64+
script: echo "Generated AVD snapshot for caching."
65+
5266
- name: Run instrumentation tests
53-
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.2
67+
uses: reactivecircus/android-emulator-runner@v2
5468
with:
55-
cmd: ./gradlew connectedCheck --stacktrace
56-
api: 18
57-
tag: default
58-
abi: x86
59-
- name: Reclaim memory
60-
run: ./gradlew --stop && jps|grep -E 'KotlinCompileDaemon|GradleDaemon'| awk '{print $1}'| xargs kill -9
61-
- name: Final checks
62-
run: ./gradlew check --stacktrace
69+
api-level: ${{ env.api-level }}
70+
force-avd-creation: false
71+
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
72+
disable-animations: true
73+
script: ./gradlew connectedCheck
74+
75+
- name: (Fail-only) Upload build reports
76+
if: failure()
77+
uses: actions/upload-artifact@v3
78+
with:
79+
name: reports
80+
path: |
81+
**/build/reports/**
82+
6383
- name: Upload snapshot (main only)
84+
if: success() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
6485
run: ./gradlew publish -PmavenCentralUsername="${{ secrets.SonatypeUsername }}" -PmavenCentralPassword="${{ secrets.SonatypePassword }}"
65-
if: success() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && matrix.java_version == '11'

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ lint_result.txt
6060
*.war
6161
*.ear
6262

63-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
63+
# virtual machine crash logs, see https://www.java.com/en/download/help/error_hotspot.xml
6464
hs_err_pid*
6565

6666

@@ -107,7 +107,7 @@ annotations/
107107

108108
# Mkdocs
109109
docs/1.x/*
110-
docs/2.x/*
110+
docs/api/2.x/*
111111
docs/changelog.md
112112
docs/contributing.md
113113
docs/code-of-conduct.md

0 commit comments

Comments
 (0)