Skip to content

Commit

Permalink
Use Gradle Build Action (#4986)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
runningcode authored Jan 17, 2025
1 parent 80c5394 commit 1dda14d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/onPush.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
31 changes: 5 additions & 26 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,15 @@ 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: |
cp .github/mock-google-services.json app/google-services.json
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

Expand All @@ -46,24 +37,15 @@ 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: |
cp .github/mock-google-services.json app/google-services.json
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

Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit 1dda14d

Please sign in to comment.