-
Notifications
You must be signed in to change notification settings - Fork 43
84 lines (70 loc) · 2.59 KB
/
ci.yml
File metadata and controls
84 lines (70 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.PAT }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Plugin unit tests
run: ./gradlew :plugin:test :plugin:jacocoTestReport :plugin:jacocoTestCoverageVerification :plugin:detekt --no-daemon
- name: Plugin integration tests (optional)
continue-on-error: true
run: ./gradlew :plugin:integrationTest --no-daemon
- name: Sample app assembleDebug
run: ./gradlew :app:assembleDebug --no-daemon
- name: Performance non-regression check (assembleDebug)
env:
PERF_MAX_SECONDS: "240"
run: |
./gradlew :app:clean --no-daemon
./gradlew :app:assembleDebug --no-daemon
start=$(date +%s)
./gradlew :app:assembleDebug --no-daemon
end=$(date +%s)
elapsed=$((end - start))
echo "Measured assembleDebug (warm) time: ${elapsed}s"
if [ "$elapsed" -gt "$PERF_MAX_SECONDS" ]; then
echo "Performance regression: ${elapsed}s > ${PERF_MAX_SECONDS}s"
exit 1
fi
agp-compat:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
agp-version: ["8.0.2", "8.7.3", "9.0.0"]
steps:
- uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.PAT }}
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set AGP version in version catalog
run: sed -i.bak 's/^agp = ".*"/agp = "${{ matrix.agp-version }}"/' gradle/libs.versions.toml
- name: Set Gradle version for selected AGP
run: |
if [ "${{ matrix.agp-version }}" = "9.0.0" ]; then
sed -i.bak 's#^distributionUrl=.*#distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip#' gradle/wrapper/gradle-wrapper.properties
else
sed -i.bak 's#^distributionUrl=.*#distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip#' gradle/wrapper/gradle-wrapper.properties
fi
- name: AGP compatibility check (assembleDebug)
run: ./gradlew :app:assembleDebug --no-daemon