Use gradle build cache action rather than manual cache usage. (#7944)

This commit is contained in:
Michael Kaye 2023-01-19 11:20:16 +00:00 committed by GitHub
parent 2ee51ecc92
commit 8e77f90348
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 39 deletions

View File

@ -25,14 +25,10 @@ jobs:
cancel-in-progress: true cancel-in-progress: true
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/cache@v3 - name: Configure gradle
uses: gradle/gradle-build-action@v2
with: with:
path: | cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Assemble ${{ matrix.target }} debug apk - name: Assemble ${{ matrix.target }} debug apk
run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES run: ./gradlew assemble${{ matrix.target }}Debug $CI_GRADLE_ARG_PROPERTIES
- name: Upload ${{ matrix.target }} debug APKs - name: Upload ${{ matrix.target }} debug APKs
@ -50,14 +46,10 @@ jobs:
cancel-in-progress: ${{ github.ref != 'refs/head/main' }} cancel-in-progress: ${{ github.ref != 'refs/head/main' }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/cache@v3 - name: Configure gradle
uses: gradle/gradle-build-action@v2
with: with:
path: | cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Assemble GPlay unsigned apk - name: Assemble GPlay unsigned apk
run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES run: ./gradlew clean assembleGplayRelease $CI_GRADLE_ARG_PROPERTIES
- name: Upload Gplay unsigned APKs - name: Upload Gplay unsigned APKs

View File

@ -19,14 +19,10 @@ jobs:
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: 3.8 python-version: 3.8
- uses: actions/cache@v3 - name: Configure gradle
uses: gradle/gradle-build-action@v2
with: with:
path: | cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Install towncrier - name: Install towncrier
run: | run: |
python3 -m pip install towncrier python3 -m pip install towncrier

View File

@ -44,14 +44,14 @@ jobs:
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: 3.8 python-version: 3.8
- uses: actions/cache@v3 - uses: actions/setup-java@v3
with: with:
path: | distribution: 'adopt'
~/.gradle/caches java-version: '11'
~/.gradle/wrapper - name: Configure gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} uses: gradle/gradle-build-action@v2
restore-keys: | with:
${{ runner.os }}-gradle- cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
- name: Start synapse server - name: Start synapse server
uses: michaelkaye/setup-matrix-synapse@v1.0.4 uses: michaelkaye/setup-matrix-synapse@v1.0.4
with: with:
@ -59,10 +59,6 @@ jobs:
httpPort: 8080 httpPort: 8080
disableRateLimiting: true disableRateLimiting: true
public_baseurl: "http://10.0.2.2:8080/" public_baseurl: "http://10.0.2.2:8080/"
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '11'
- name: Run sanity tests on API ${{ matrix.api-level }} - name: Run sanity tests on API ${{ matrix.api-level }}
uses: reactivecircus/android-emulator-runner@v2 uses: reactivecircus/android-emulator-runner@v2
with: with:

View File

@ -139,14 +139,10 @@ jobs:
# with: # with:
# distribution: 'adopt' # distribution: 'adopt'
# java-version: 11 # java-version: 11
# - uses: actions/cache@v3 # - name: Configure gradle
# uses: gradle/gradle-build-action@v2
# with: # with:
# path: | # cache-read-only: ${{ github.ref != 'refs/heads/develop' }}
# ~/.gradle/caches
# ~/.gradle/wrapper
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# - name: Build Android Tests # - name: Build Android Tests
# run: ./gradlew clean assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES # run: ./gradlew clean assembleAndroidTest $CI_GRADLE_ARG_PROPERTIES