Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5228108
Update to Gradle 8.2.1
ZacSweers Jul 22, 2023
f16211b
Switch to version catalogs + update all deps
ZacSweers Jul 22, 2023
e5a4762
Update CI
ZacSweers Jul 22, 2023
d8fef6f
Convert most build files to kts
ZacSweers Jul 22, 2023
350ab5a
Migrate root build files
ZacSweers Jul 22, 2023
b203521
Fixes
ZacSweers Jul 22, 2023
3972b85
Spotless config
ZacSweers Jul 22, 2023
880cb37
Switch to ktfmt and update gjf
ZacSweers Jul 22, 2023
e6af7df
Run spotless
ZacSweers Jul 22, 2023
88099eb
Replace http:// with https:// repo-wide
ZacSweers Jul 22, 2023
6101f47
Spotless md files
ZacSweers Jul 22, 2023
bd6b981
New KGP APIs
ZacSweers Jul 22, 2023
7ddf7e7
Switch to ksp + autoserviceksp
ZacSweers Jul 22, 2023
f5021b5
Set up error prone in sample finally
ZacSweers Jul 22, 2023
4226065
re-enable animalsniffer
ZacSweers Jul 22, 2023
6cdf55a
Simplify and clean up common build config
ZacSweers Jul 22, 2023
8c7195f
Update EP stuff and compile sdk 33
ZacSweers Jul 22, 2023
8e33001
Update kotlin version in lint
ZacSweers Jul 22, 2023
27b7ccb
Fix compilation for EP checks
ZacSweers Jul 22, 2023
f182cf2
Make AutoDisposeDetector handle changed parameter order
ZacSweers Jul 22, 2023
5164f69
Clean up some old test controls
ZacSweers Jul 22, 2023
757f924
Final fixes
ZacSweers Jul 22, 2023
939a60d
Modernize CI
ZacSweers Jul 22, 2023
392ec1e
Modernize releasing/publishing/dokka
ZacSweers Jul 22, 2023
ade0fe3
Use env for api instead of matrix
ZacSweers Jul 22, 2023
49cbb4f
Fix androidTests
ZacSweers Jul 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 66 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,65 +1,85 @@
name: CI

on: [push, pull_request]
on:
# Only run push on main
push:
branches:
- main
paths-ignore:
- '**/*.md'
# Always run on PRs
pull_request:
branches: [ main ]
merge_group:

concurrency:
group: 'ci-${{ github.event.merge_group.head_ref || github.head_ref }}-${{ github.workflow }}'
cancel-in-progress: true

jobs:
build:
name: JDK ${{ matrix.java_version }}
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
java_version: [11]
env:
api-level: "18"
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Install JDK ${{ matrix.java_version }}

- name: Install JDK
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: ${{ matrix.java_version }}
- name: Install Android SDK
uses: malinskiy/action-android/install-sdk@release/0.1.2
- run: sdkmanager platform-tools
# TODO Caching disabled for now due to the size of Gradle's cache rendering this super slow
# - name: Cache build .gradle dir
# uses: actions/cache@v1.0.1
# with:
# path: .gradle
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# - name: Cache user .gradle dir
# uses: actions/cache@v1.0.1
# with:
# path: ~/.gradle
# key: ${{ runner.os }}-gradleuser-${{ hashFiles('**/*.gradle') }}
# restore-keys: |
# ${{ runner.os }}-gradleuser-
- name: Configure Gradle
# Initial gradle configuration, install dependencies, etc
run: ./gradlew help
- name: Spot check
# Run spotless first to fail fast on spotless issues
run: ./gradlew spotlessCheck --stacktrace
- name: Build project
run: ./gradlew assemble --stacktrace
java-version: '17'

- name: Gradle cache
uses: gradle/gradle-build-action@v2

# TODO split test and instrumentation into parallel builds
- name: Run tests
run: ./gradlew test --stacktrace
- name: Build and run unit tests
id: gradle
uses: gradle/gradle-build-action@v2
with:
arguments: check

- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ env.api-level }}

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ env.api-level }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: Run instrumentation tests
uses: malinskiy/action-android/emulator-run-cmd@release/0.1.2
uses: reactivecircus/android-emulator-runner@v2
with:
cmd: ./gradlew connectedCheck --stacktrace
api: 18
tag: default
abi: x86
- name: Reclaim memory
run: ./gradlew --stop && jps|grep -E 'KotlinCompileDaemon|GradleDaemon'| awk '{print $1}'| xargs kill -9
- name: Final checks
run: ./gradlew check --stacktrace
api-level: ${{ env.api-level }}
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew connectedCheck

- name: (Fail-only) Upload build reports
if: failure()
uses: actions/upload-artifact@v3
with:
name: reports
path: |
**/build/reports/**

- name: Upload snapshot (main only)
if: success() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: ./gradlew publish -PmavenCentralUsername="${{ secrets.SonatypeUsername }}" -PmavenCentralPassword="${{ secrets.SonatypePassword }}"
if: success() && github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && matrix.java_version == '11'
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ lint_result.txt
*.war
*.ear

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


Expand Down Expand Up @@ -107,7 +107,7 @@ annotations/

# Mkdocs
docs/1.x/*
docs/2.x/*
docs/api/2.x/*
docs/changelog.md
docs/contributing.md
docs/code-of-conduct.md
Loading