From 1dda14d419c673f77c4a9efbcc595125a63d0ec6 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Fri, 17 Jan 2025 02:17:18 -0500 Subject: [PATCH] Use Gradle Build Action (#4986) This adds the Gradle build action to all Gradle workflows to speed up builds using caching. This replaces the Github action cache as well as the Gradle Wrapper Validation action since the Gradle Build action [performs the same validation](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#gradle-wrapper-validation) --- .github/workflows/onPush.yml | 10 ++-------- .github/workflows/pr.yml | 31 +++++-------------------------- 2 files changed, 7 insertions(+), 34 deletions(-) diff --git a/.github/workflows/onPush.yml b/.github/workflows/onPush.yml index b151933cecf..abdaa748b9d 100644 --- a/.github/workflows/onPush.yml +++ b/.github/workflows/onPush.yml @@ -70,10 +70,7 @@ jobs: KEYSTORE_ALIAS_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }} VERSION_CODE: ${{ steps.rel_number.outputs.version-code }} run: | - ./gradlew :common:assemble - ./gradlew :app:assembleRelease - ./gradlew :wear:assembleRelease - ./gradlew :automotive:assembleRelease + ./gradlew :common:assemble :app:assembleRelease :wear:assembleRelease :automotive:assembleRelease - name: Archive Build uses: actions/upload-artifact@v4 @@ -181,10 +178,7 @@ jobs: KEYSTORE_ALIAS_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_ALIAS_PASSWORD }} VERSION_CODE: ${{ steps.rel_number.outputs.version-code }} run: | - ./gradlew :common:assemble - ./gradlew :app:bundleFullRelease - ./gradlew :wear:bundleRelease - ./gradlew :automotive:bundleFullRelease + ./gradlew :common:assemble :app:bundleFullRelease :wear:bundleRelease :automotive:bundleFullRelease - name: Archive Build uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 0b202ea5cea..bb1bfa50066 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,14 +15,8 @@ jobs: distribution: 'temurin' java-version: '17' - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Mock google-services.json run: | @@ -30,9 +24,6 @@ jobs: cp .github/mock-google-services.json wear/google-services.json cp .github/mock-google-services.json automotive/google-services.json - - uses: gradle/actions/wrapper-validation@v4 - name: Validate Gradle Wrapper - - name: Validate ktlint run: ./gradlew ktlintCheck @@ -46,14 +37,8 @@ jobs: distribution: 'temurin' java-version: '17' - - uses: actions/cache@v4 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} - restore-keys: | - ${{ runner.os }}-gradle- + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 - name: Mock google-services.json run: | @@ -61,9 +46,6 @@ jobs: cp .github/mock-google-services.json wear/google-services.json cp .github/mock-google-services.json automotive/google-services.json - - uses: gradle/actions/wrapper-validation@v4 - name: Validate Gradle Wrapper - - name: Validate Lint run: ./gradlew lint @@ -102,10 +84,7 @@ jobs: - name: Build Debug APK run: | - ./gradlew :common:assemble - ./gradlew :app:assembleDebug - ./gradlew :wear:assembleDebug - ./gradlew :automotive:assembleDebug + ./gradlew :common:assemble :app:assembleDebug :wear:assembleDebug :automotive:assembleDebug - name: Check for missing/modified DB schemas after build run: |