Skip to content

Commit e268272

Browse files
committed
Merge branch 'android-remote-main' into remove-runner
Change-Id: I5535315c6159e3b70e8591b60a50d2e0607efe97 # Conflicts: # core/designsystem/build.gradle.kts
2 parents 0e44f1b + 57d98cc commit e268272

File tree

296 files changed

+4561
-18565
lines changed

Some content is hidden

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

296 files changed

+4561
-18565
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,13 @@
55
ij_kotlin_allow_trailing_comma=true
66
ij_kotlin_allow_trailing_comma_on_call_site=true
77
ktlint_function_naming_ignore_when_annotated_with=Composable, Test
8+
ktlint_standard_backing-property-naming = disabled
9+
ktlint_standard_binary-expression-wrapping = disabled
10+
ktlint_standard_chain-method-continuation = disabled
11+
ktlint_standard_class-signature = disabled
12+
ktlint_standard_condition-wrapping = disabled
13+
ktlint_standard_function-expression-body = disabled
14+
ktlint_standard_function-literal = disabled
15+
ktlint_standard_function-type-modifier-spacing = disabled
16+
ktlint_standard_multiline-loop = disabled
17+
ktlint_standard_function-signature = disabled

.github/dependabot.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ updates:
1212
registries: "*"
1313
labels: [ "version update" ]
1414
groups:
15-
kotlin-ksp-compose:
15+
kotlin-ksp:
1616
patterns:
1717
- "org.jetbrains.kotlin:*"
1818
- "org.jetbrains.kotlin.jvm"
1919
- "com.google.devtools.ksp"
20-
- "androidx.compose.compiler:compiler"
2120
open-pull-requests-limit: 10
2221
registries:
2322
maven-google:

.github/workflows/Build.yaml

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ jobs:
2525
- name: Checkout
2626
uses: actions/checkout@v4
2727

28-
- name: Validate Gradle Wrapper
29-
uses: gradle/wrapper-validation-action@v3
28+
- name: Enable KVM group perms
29+
run: |
30+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
31+
sudo udevadm control --reload-rules
32+
sudo udevadm trigger --name-match=kvm
33+
ls /dev/kvm
3034
3135
- name: Copy CI gradle.properties
3236
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
@@ -38,7 +42,13 @@ jobs:
3842
java-version: 17
3943

4044
- name: Setup Gradle
41-
uses: gradle/gradle-build-action@v3
45+
uses: gradle/actions/setup-gradle@v4
46+
47+
- name: Setup Android SDK
48+
uses: android-actions/setup-android@v3
49+
50+
- name: Accept licenses
51+
run: yes | sdkmanager --licenses || true
4252

4353
- name: Check build-logic
4454
run: ./gradlew check -p build-logic
@@ -83,7 +93,9 @@ jobs:
8393
continue-on-error: false
8494
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
8595
run: |
86-
echo "::error::Screenshot tests failed, please create a PR in your fork first." && exit 1
96+
echo "::error::Screenshot tests failed, please create a PR in your fork first."
97+
echo "Your fork's CI will take screenshots for your fork."
98+
exit 1
8799
88100
# Runs if previous job failed
89101
- name: Generate new screenshots if verification failed and it's a PR
@@ -101,19 +113,22 @@ jobs:
101113
commit_message: "🤖 Updates screenshots"
102114

103115
# Run local tests after screenshot tests to avoid wrong UP-TO-DATE. TODO: Ignore screenshots.
104-
- name: Run local tests and create report
105-
if: always()
116+
- name: Run local tests
106117
run: ./gradlew testDemoDebug :lint:test
107-
# Replace task exclusions with `-Pandroidx.baselineprofile.skipgeneration` when
108-
# https://android-review.googlesource.com/c/platform/frameworks/support/+/2602790 landed in a
109-
# release build
118+
119+
- name: Setup GMD
120+
run: ./gradlew :benchmarks:pixel6Api33Setup
121+
--info
122+
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
123+
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
110124

111125
- name: Build all build type and flavor permutations
112-
run: ./gradlew :app:assemble :benchmarks:assemble
113-
-x pixel6Api33ProdNonMinifiedReleaseAndroidTest
114-
-x pixel6Api33DemoNonMinifiedReleaseAndroidTest
115-
-x collectDemoNonMinifiedReleaseBaselineProfile
116-
-x collectProdNonMinifiedReleaseBaselineProfile
126+
run: ./gradlew :app:assemble :benchmarks:assemble -Pandroidx.baselineprofile.skipgeneration
127+
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
128+
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
129+
-Pandroid.experimental.androidTest.numManagedDeviceShards=1
130+
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1
131+
-Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=5
117132

118133
- name: Upload build outputs (APKs)
119134
uses: actions/upload-artifact@v4
@@ -122,14 +137,14 @@ jobs:
122137
path: '**/build/outputs/apk/**/*.apk'
123138

124139
- name: Upload JVM local results (XML)
125-
if: always()
140+
if: ${{ !cancelled() }}
126141
uses: actions/upload-artifact@v4
127142
with:
128143
name: local-test-results
129144
path: '**/build/test-results/test*UnitTest/**.xml'
130145

131146
- name: Upload screenshot results (PNG)
132-
if: always()
147+
if: ${{ !cancelled() }}
133148
uses: actions/upload-artifact@v4
134149
with:
135150
name: screenshot-test-results
@@ -139,12 +154,18 @@ jobs:
139154
run: ./gradlew :app:lintProdRelease :app-nia-catalog:lintRelease :lint:lint
140155

141156
- name: Upload lint reports (HTML)
142-
if: always()
157+
if: ${{ !cancelled() }}
143158
uses: actions/upload-artifact@v4
144159
with:
145160
name: lint-reports
146161
path: '**/build/reports/lint-results-*.html'
147162

163+
- name: Upload lint reports (SARIF)
164+
if: always()
165+
uses: github/codeql-action/upload-sarif@v3
166+
with:
167+
sarif_file: './'
168+
148169
- name: Check badging
149170
run: ./gradlew :app:checkProdReleaseBadging
150171

@@ -153,7 +174,7 @@ jobs:
153174
timeout-minutes: 55
154175
strategy:
155176
matrix:
156-
api-level: [26, 30]
177+
api-level: [26, 34]
157178

158179
steps:
159180
- name: Delete unnecessary tools 🔧
@@ -187,7 +208,10 @@ jobs:
187208
java-version: 17
188209

189210
- name: Setup Gradle
190-
uses: gradle/gradle-build-action@v3
211+
uses: gradle/actions/setup-gradle@v4
212+
with:
213+
validate-wrappers: true
214+
gradle-home-cache-cleanup: true
191215

192216
- name: Build projects and run instrumentation tests
193217
uses: reactivecircus/android-emulator-runner@v2
@@ -210,7 +234,7 @@ jobs:
210234
run: ./gradlew createDemoDebugCombinedCoverageReport
211235

212236
- name: Upload test reports
213-
if: always()
237+
if: ${{ !cancelled() }}
214238
uses: actions/upload-artifact@v4
215239
with:
216240
name: test-reports-${{ matrix.api-level }}
@@ -219,7 +243,7 @@ jobs:
219243
- name: Display local test coverage (only API 30)
220244
if: matrix.api-level == 30
221245
id: jacoco
222-
uses: madrapps/jacoco-report@v1.6.1
246+
uses: madrapps/jacoco-report@v1.7.1
223247
with:
224248
title: Combined test coverage report
225249
min-coverage-overall: 40
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: NightlyBaselineProfiles
2+
3+
on:
4+
schedule:
5+
- cron: '42 4 * * *'
6+
7+
jobs:
8+
baseline_profiles:
9+
name: "Generate Baseline Profiles"
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
contents: write
14+
15+
timeout-minutes: 60
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Enable KVM group perms
22+
run: |
23+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
24+
sudo udevadm control --reload-rules
25+
sudo udevadm trigger --name-match=kvm
26+
ls /dev/kvm
27+
28+
- name: Copy CI gradle.properties
29+
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
30+
31+
- name: Set up JDK 17
32+
uses: actions/setup-java@v4
33+
with:
34+
distribution: 'zulu'
35+
java-version: 17
36+
37+
- name: Setup Gradle
38+
uses: gradle/actions/setup-gradle@v4
39+
40+
- name: Setup Android SDK
41+
uses: android-actions/setup-android@v3
42+
43+
- name: Accept licenses
44+
run: yes | sdkmanager --licenses || true
45+
46+
- name: Check build-logic
47+
run: ./gradlew check -p build-logic
48+
49+
- name: Setup GMD
50+
run: ./gradlew :benchmarks:pixel6Api33Setup
51+
--info
52+
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
53+
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
54+
55+
- name: Build all build type and flavor permutations including baseline profiles
56+
run: ./gradlew :app:assemble
57+
-Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=baselineprofile
58+
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
59+
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true

.github/workflows/Release.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ jobs:
1919
ls /dev/kvm
2020
2121
- name: Checkout
22-
uses: actions/checkout@v4
2322

24-
- name: Validate Gradle Wrapper
25-
uses: gradle/wrapper-validation-action@v3
23+
uses: actions/checkout@v4
2624

2725
- name: Copy CI gradle.properties
2826
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
@@ -33,11 +31,20 @@ jobs:
3331
distribution: 'zulu'
3432
java-version: 17
3533

36-
- name: Install GMD image for baseline profile generation
37-
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager "system-images;android-33;aosp_atd;x86_64"
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@v4
3836

39-
- name: Accept Android licenses
40-
run: yes | "$ANDROID_HOME"/cmdline-tools/latest/bin/sdkmanager --licenses || true
37+
- name: Setup Android SDK
38+
uses: android-actions/setup-android@v3
39+
40+
- name: Accept licenses
41+
run: yes | sdkmanager --licenses || true
42+
43+
- name: Setup GMD
44+
run: ./gradlew :benchmarks:pixel6Api33Setup
45+
--info
46+
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
47+
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
4148

4249
- name: Build release variant including baseline profile generation
4350
run: ./gradlew :app:assembleDemoRelease

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ bin/
1313
gen/
1414
out/
1515
build/
16+
generated/
1617

1718
# Local configuration file (sdk path, etc)
1819
local.properties
@@ -43,3 +44,6 @@ _sandbox
4344

4445
# Android Studio captures folder
4546
captures/
47+
48+
# Kotlin
49+
.kotlin

.google/BUILDME

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# This file can be used to trigger an internal build by changing the number below
2-
3
2+
2

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,13 @@ Examples:
111111

112112
To run the tests execute the following gradle tasks:
113113

114-
- `testDemoDebug` run all local tests against the `demoDebug` variant.
114+
- `testDemoDebug` run all local tests against the `demoDebug` variant. Screenshot tests will fail
115+
(see below for explanation). To avoid this, run `recordRoborazziDemoDebug` prior to running unit tests.
115116
- `connectedDemoDebugAndroidTest` run all instrumented tests against the `demoDebug` variant.
116117

117-
**Note:** You should not run `./gradlew test` or `./gradlew connectedAndroidTest` as this will execute
118-
tests against _all_ build variants which is both unecessary and will result in failures as only the
118+
> [!NOTE]
119+
> You should not run `./gradlew test` or `./gradlew connectedAndroidTest` as this will execute
120+
tests against _all_ build variants which is both unnecessary and will result in failures as only the
119121
`demoDebug` variant is supported. No other variants have any tests (although this might change in future).
120122

121123
## Screenshot tests
@@ -137,7 +139,9 @@ stored in `modulename/src/test/screenshots`.
137139
- `compareRoborazziDemoDebug` create comparison images between failed tests and the known correct
138140
images. These can also be found in `modulename/src/test/screenshots`.
139141

140-
**Note:** The known correct screenshots stored in this repository are recorded on CI using Linux. Other
142+
> [!NOTE]
143+
> **Note on failing screenshot tests**
144+
> The known correct screenshots stored in this repository are recorded on CI using Linux. Other
141145
platforms may (and probably will) generate slightly different images, making the screenshot tests fail.
142146
When working on a non-Linux platform, a workaround to this is to run `recordRoborazziDemoDebug` on the
143147
`main` branch before starting work. After making changes, `verifyRoborazziDemoDebug` will identify only

0 commit comments

Comments
 (0)