-
Notifications
You must be signed in to change notification settings - Fork 19
266 lines (265 loc) · 10.5 KB
/
main.yml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: SDK Main Workflow
# The on: and concurrencency: blocks should be the same for all core workflows
# Triggers nightly, on merges or pushes to main and stable and on pull requests.
on:
push:
branches:
- main
- 'stable/**'
- 'feature/**'
pull_request:
merge_group:
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
permissions:
contents: read
# We only need to make sure that one ABI builds
env:
GRADLE_OPTS: "-Dorg.gradle.project.designcompose.cargoPlugin.allowAbiOverride=true -Dorg.gradle.project.designcompose.cargoPlugin.abiOverride=x86_64"
jobs:
############## Gradle
sdk-support-build:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-gradle: true
- name: Test build-logic
working-directory: build-logic
run: ./gradlew test
- name: Test the plugins
working-directory: plugins
run: ./gradlew test
# Run a full build, including instrumented tests.
sdk-build:
runs-on: "ubuntu-latest"
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-gradle: true
setup-protoc: true
setup-rust: true
- name: Full Gradle Test
run: ./gradlew assembleDebug assembleAndroidTest assembleUnitTest test
build-maven-repo:
runs-on: "ubuntu-latest"
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2
- name: "Set environment variables"
run: |
echo "ORG_GRADLE_PROJECT_DesignComposeMavenRepo=$GITHUB_WORKSPACE/designcompose_m2repo" >> "$GITHUB_ENV"
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-gradle: true
setup-protoc: true
setup-rust: true
- name: Full Gradle Test and publish
run: ./gradlew publishAllPublicationsToLocalDirRepository
- name: Upload maven repo
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: designcompose_m2repo
path: designcompose_m2repo/
# These tests run on the local JVM and don't need the rust code,
# so it makes sense to put them in a seperate job
verify-roborazzi:
runs-on: "ubuntu-latest"
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-gradle: true
- name: Generate full comparison
run: ./gradlew compareRoborazziDebug
- name: Upload diff report
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: screenshot-diff-report
path: |
**/build/outputs/roborazzi
**/build/reports/roborazzi
retention-days: 30
- name: Verify Roborazzi
run: ./gradlew verifyRoborazziDebug
########### Reference apps
reference-apps:
strategy:
matrix:
# Windows and mac tests disabled until #883 is fixed
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
needs: build-maven-repo
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-gradle: true
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: designcompose_m2repo
path: designcompose_m2repo
- name: "Set environment variables (Linux/Mac)"
if: ${{ matrix.os != 'windows-latest'}}
run: |
echo "ORG_GRADLE_PROJECT_DesignComposeMavenRepo=$GITHUB_WORKSPACE/designcompose_m2repo" >> "$GITHUB_ENV"
- name: "Set environment variables (Windows)"
if: ${{ matrix.os == 'windows-latest'}}
run: |
chcp 65001 #set code page to utf-8
echo "ORG_GRADLE_PROJECT_DesignComposeMavenRepo=$env:GITHUB_WORKSPACE/designcompose_m2repo" >> "$env:GITHUB_ENV"
- name: Check HelloWorld App
working-directory: reference-apps/helloworld
run: ./gradlew --init-script ../local-design-compose-repo.init.gradle.kts build
- name: Check Tutorial App
working-directory: reference-apps/tutorial
run: ./gradlew --init-script ../local-design-compose-repo.init.gradle.kts build
build-unbundled:
runs-on: ubuntu-22.04-32core
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-gradle: true
- run: sudo apt-get install repo
- name: "Set environment variables"
run: |
echo "ORG_GRADLE_PROJECT_unbundledAAOSDir=$GITHUB_WORKSPACE/unbundled-aaos" >> "$GITHUB_ENV"
- name: Check out the Unbundled AAOS Repo
run: |
HOST=https://android.googlesource.com/platform/manifest
BRANCH=ub-automotive-master-20240521
mkdir "$ORG_GRADLE_PROJECT_unbundledAAOSDir"
cd "$ORG_GRADLE_PROJECT_unbundledAAOSDir"
repo init -u $HOST -b $BRANCH -g pdk,pdk-fs --depth=1
repo sync -cq -j4
- name: Build the repo
working-directory: unbundled-aaos/packages/apps/Car/libs/aaos-apps-gradle-project/
run: ./gradlew publishAllPublicationsToLocalRepository
- name: Upload maven repo
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: unbundled_m2repo
path: unbundled-aaos/out/aaos-apps-gradle-build/unbundled_m2repo/
- name: Upload aaos prebuilts
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: unbundled_prebuilts
path: unbundled-aaos/prebuilts/sdk/34/system/
######### Unbundled apps
MediaCompose:
runs-on: ubuntu-latest
needs: [build-maven-repo, build-unbundled]
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-gradle: true
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: designcompose_m2repo
path: designcompose_m2repo
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: unbundled_m2repo
path: unbundled-aaos/out/aaos-apps-gradle-build/unbundled_m2repo/
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: unbundled_prebuilts
path: unbundled-aaos/prebuilts/sdk/34/system/
- run: sudo apt-get install repo
- name: "Set environment variables"
run: |
echo "ORG_GRADLE_PROJECT_DesignComposeMavenRepo=$GITHUB_WORKSPACE/designcompose_m2repo" >> "$GITHUB_ENV"
echo "ORG_GRADLE_PROJECT_unbundledAAOSDir=$GITHUB_WORKSPACE/unbundled-aaos" >> "$GITHUB_ENV"
- name: Check MediaCompose
working-directory: reference-apps/aaos-unbundled
run: ./gradlew --init-script ../local-design-compose-repo.init.gradle.kts check
############# Rust
rust-test:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2
- run: rustup toolchain install stable --profile minimal
- name: Set up Build
uses: ./.github/actions/setup-build
with:
setup-protoc: true
setup-rust: true
- name: Build all
run: cargo build --all-targets --all-features
- name: Test all
run: cargo test --all-targets --features=reflection,fetch,dcf_info
############ Figma resources
figma-resources:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v3.5.2
- uses: ./.github/actions/build-figma-resource
with:
resource: auto-content-preview-widget
- uses: ./.github/actions/build-figma-resource
with:
resource: extended-layout-plugin