Skip to content

Commit aa18b8b

Browse files
committed
Merge branch 'android-remote-main' into fix-snackbar
Change-Id: If0f12500cb55daae98fd7ee0951d3d3384d26b0e # Conflicts: # app/src/testDemo/screenshots/insets_snackbar_compact_medium.png # app/src/testDemo/screenshots/insets_snackbar_expanded_expanded.png # app/src/testDemo/screenshots/insets_snackbar_medium_medium.png
2 parents c6bc179 + a0f2786 commit aa18b8b

File tree

206 files changed

+1098
-594
lines changed

Some content is hidden

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

206 files changed

+1098
-594
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/ci-gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
org.gradle.daemon=false
1818
org.gradle.parallel=true
1919
org.gradle.workers.max=2
20+
org.gradle.configuration-cache=true
21+
org.gradle.configuration-cache.parallel=true
2022

2123
kotlin.incremental=false
2224

.github/dependabot.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/renovate.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"local>android/.github:renovate-config"
5+
],
6+
"baseBranches": [
7+
"main"
8+
],
9+
"gitIgnoredAuthors": [
10+
"renovate[bot]@users.noreply.github.com",
11+
"github-actions[bot]@users.noreply.github.com",
12+
"41898282+github-actions[bot]@users.noreply.github.com"
13+
]
14+
}

.github/workflows/Build.yaml

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,14 @@ jobs:
1818
permissions:
1919
contents: write
2020
pull-requests: write
21+
security-events: write
2122

2223
timeout-minutes: 60
2324

2425
steps:
2526
- name: Checkout
2627
uses: actions/checkout@v4
2728

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
34-
3529
- name: Copy CI gradle.properties
3630
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
3731

@@ -43,15 +37,11 @@ jobs:
4337

4438
- name: Setup Gradle
4539
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
40+
with:
41+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
5242

5343
- name: Check build-logic
54-
run: ./gradlew check -p build-logic
44+
run: ./gradlew :build-logic:convention:check
5545

5646
- name: Check spotless
5747
run: ./gradlew spotlessCheck --init-script gradle/init.gradle.kts --no-configuration-cache
@@ -93,7 +83,9 @@ jobs:
9383
continue-on-error: false
9484
if: steps.screenshotsverify.outcome == 'failure' && github.event.pull_request.head.repo.full_name != github.repository
9585
run: |
96-
echo "::error::Screenshot tests failed, please create a PR in your fork first." && exit 1
86+
echo "::error::Screenshot tests failed, please create a PR in your fork first."
87+
echo "Your fork's CI will take screenshots for your fork."
88+
exit 1
9789
9890
# Runs if previous job failed
9991
- name: Generate new screenshots if verification failed and it's a PR
@@ -114,19 +106,8 @@ jobs:
114106
- name: Run local tests
115107
run: ./gradlew testDemoDebug :lint:test
116108

117-
- name: Setup GMD
118-
run: ./gradlew :benchmarks:pixel6Api33Setup
119-
--info
120-
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
121-
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
122-
123109
- name: Build all build type and flavor permutations
124-
run: ./gradlew :app:assemble :benchmarks:assemble -Pandroidx.baselineprofile.skipgeneration
125-
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
126-
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
127-
-Pandroid.experimental.androidTest.numManagedDeviceShards=1
128-
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1
129-
-Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes=5
110+
run: ./gradlew :app:assemble
130111

131112
- name: Upload build outputs (APKs)
132113
uses: actions/upload-artifact@v4
@@ -135,14 +116,14 @@ jobs:
135116
path: '**/build/outputs/apk/**/*.apk'
136117

137118
- name: Upload JVM local results (XML)
138-
if: always()
119+
if: ${{ !cancelled() }}
139120
uses: actions/upload-artifact@v4
140121
with:
141122
name: local-test-results
142123
path: '**/build/test-results/test*UnitTest/**.xml'
143124

144125
- name: Upload screenshot results (PNG)
145-
if: always()
126+
if: ${{ !cancelled() }}
146127
uses: actions/upload-artifact@v4
147128
with:
148129
name: screenshot-test-results
@@ -152,12 +133,18 @@ jobs:
152133
run: ./gradlew :app:lintProdRelease :app-nia-catalog:lintRelease :lint:lint
153134

154135
- name: Upload lint reports (HTML)
155-
if: always()
136+
if: ${{ !cancelled() }}
156137
uses: actions/upload-artifact@v4
157138
with:
158139
name: lint-reports
159140
path: '**/build/reports/lint-results-*.html'
160141

142+
- name: Upload lint reports (SARIF)
143+
if: ${{ !cancelled() && hashFiles('**/*.sarif') != '' }}
144+
uses: github/codeql-action/upload-sarif@v3
145+
with:
146+
sarif_file: './'
147+
161148
- name: Check badging
162149
run: ./gradlew :app:checkProdReleaseBadging
163150

@@ -166,7 +153,7 @@ jobs:
166153
timeout-minutes: 55
167154
strategy:
168155
matrix:
169-
api-level: [26, 30]
156+
api-level: [26, 34]
170157

171158
steps:
172159
- name: Delete unnecessary tools 🔧
@@ -202,8 +189,7 @@ jobs:
202189
- name: Setup Gradle
203190
uses: gradle/actions/setup-gradle@v4
204191
with:
205-
validate-wrappers: true
206-
gradle-home-cache-cleanup: true
192+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
207193

208194
- name: Build projects and run instrumentation tests
209195
uses: reactivecircus/android-emulator-runner@v2
@@ -226,7 +212,7 @@ jobs:
226212
run: ./gradlew createDemoDebugCombinedCoverageReport
227213

228214
- name: Upload test reports
229-
if: always()
215+
if: ${{ !cancelled() }}
230216
uses: actions/upload-artifact@v4
231217
with:
232218
name: test-reports-${{ matrix.api-level }}
@@ -235,7 +221,7 @@ jobs:
235221
- name: Display local test coverage (only API 30)
236222
if: matrix.api-level == 30
237223
id: jacoco
238-
uses: madrapps/[email protected].0
224+
uses: madrapps/[email protected].1
239225
with:
240226
title: Combined test coverage report
241227
min-coverage-overall: 40

.github/workflows/NightlyBaselineProfiles.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
baseline_profiles:
99
name: "Generate Baseline Profiles"
10+
if: github.repository == 'android/nowinandroid'
1011
runs-on: ubuntu-latest
1112

1213
permissions:
@@ -36,6 +37,8 @@ jobs:
3637

3738
- name: Setup Gradle
3839
uses: gradle/actions/setup-gradle@v4
40+
with:
41+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3942

4043
- name: Setup Android SDK
4144
uses: android-actions/setup-android@v3
@@ -44,7 +47,7 @@ jobs:
4447
run: yes | sdkmanager --licenses || true
4548

4649
- name: Check build-logic
47-
run: ./gradlew check -p build-logic
50+
run: ./gradlew :build-logic:convention:check
4851

4952
- name: Setup GMD
5053
run: ./gradlew :benchmarks:pixel6Api33Setup

.github/workflows/Release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
jobs:
99
build:
10+
if: github.repository == 'android/nowinandroid'
1011
runs-on: ubuntu-latest
1112
timeout-minutes: 120
1213

@@ -33,6 +34,8 @@ jobs:
3334

3435
- name: Setup Gradle
3536
uses: gradle/actions/setup-gradle@v4
37+
with:
38+
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3639

3740
- name: Setup Android SDK
3841
uses: android-actions/setup-android@v3

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ To run the tests execute the following gradle tasks:
115115
(see below for explanation). To avoid this, run `recordRoborazziDemoDebug` prior to running unit tests.
116116
- `connectedDemoDebugAndroidTest` run all instrumented tests against the `demoDebug` variant.
117117

118-
**Note:** You should not run `./gradlew test` or `./gradlew connectedAndroidTest` as this will execute
119-
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
120121
`demoDebug` variant is supported. No other variants have any tests (although this might change in future).
121122

122123
## Screenshot tests
@@ -138,7 +139,9 @@ stored in `modulename/src/test/screenshots`.
138139
- `compareRoborazziDemoDebug` create comparison images between failed tests and the known correct
139140
images. These can also be found in `modulename/src/test/screenshots`.
140141

141-
**Note on failing screenshot tests:** 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
142145
platforms may (and probably will) generate slightly different images, making the screenshot tests fail.
143146
When working on a non-Linux platform, a workaround to this is to run `recordRoborazziDemoDebug` on the
144147
`main` branch before starting work. After making changes, `verifyRoborazziDemoDebug` will identify only

0 commit comments

Comments
 (0)