SDK Main Workflow #5477
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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-latest | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 | |
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 |