mirror of
https://github.com/bitfireAT/davx5-ose
synced 2024-10-04 18:33:49 +00:00
Correctly save app/build and configuration cache for dev branch builds
This commit is contained in:
parent
fb7658cfaa
commit
f8b1cd5b3c
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
|
@ -37,11 +37,11 @@ jobs:
|
|||
run: echo ${{ secrets.android_keystore_base64 }} | base64 -d >$GITHUB_WORKSPACE/keystore.jks
|
||||
|
||||
- name: Export library definitions
|
||||
# --no-build-cache and --no-configuration-cache are required for AboutLibraries (bitfireAT/davx5#263, mikepenz/AboutLibraries#857).
|
||||
# Safe to remove as soon as AboutLibraries is compatible with these caches.
|
||||
run: ./gradlew --no-build-cache --no-configuration-cache -PaboutLibraries.exportPath=src/main/res/raw/ app:exportLibraryDefinitions
|
||||
|
||||
- name: Build signed package
|
||||
# --no-configuration-cache is only required for AboutLibraries (bitfireAT/davx5#263, mikepenz/AboutLibraries#857)
|
||||
# Remove it as soon as AboutLibraries is compatible with the gradle configuration cache.
|
||||
run: ./gradlew app:assembleRelease
|
||||
env:
|
||||
ANDROID_KEYSTORE: ${{ github.workspace }}/keystore.jks
|
||||
|
|
38
.github/workflows/test-dev.yml
vendored
38
.github/workflows/test-dev.yml
vendored
|
@ -20,11 +20,20 @@ jobs:
|
|||
java-version: 17
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
|
||||
- name: Create app/build and gradle configuration cache
|
||||
if: ${{ github.ref == 'refs/heads/dev-ose' }}
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: app_build-tests-without-emulator-${{ github.run_id }}
|
||||
path: |
|
||||
.gradle/configuration-cache
|
||||
app/build
|
||||
- name: Use app/build and gradle configuration cache
|
||||
if: ${{ github.ref != 'refs/heads/dev-ose' }}
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
key: app_build-tests-without-emulator
|
||||
restore-keys: app_build-tests-without-emulator- # restore cache from dev branch
|
||||
path: |
|
||||
.gradle/configuration-cache
|
||||
app/build
|
||||
|
@ -39,15 +48,6 @@ jobs:
|
|||
app/build/outputs/lint*
|
||||
app/build/reports
|
||||
|
||||
- name: Cache app/build and gradle configuration
|
||||
if: ${{ github.ref == 'refs/heads/dev-ose' }}
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
key: app_build-tests-without-emulator
|
||||
path: |
|
||||
.gradle/configuration-cache
|
||||
app/build
|
||||
|
||||
test_on_emulator:
|
||||
name: Tests with emulator
|
||||
runs-on: ubuntu-latest-4-cores
|
||||
|
@ -62,11 +62,20 @@ jobs:
|
|||
java-version: 17
|
||||
- uses: gradle/gradle-build-action@v2
|
||||
|
||||
- name: Create app/build and gradle configuration cache
|
||||
if: ${{ github.ref == 'refs/heads/dev-ose' }}
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: app_build-tests-without-emulator-${{ github.run_id }}
|
||||
path: |
|
||||
.gradle/configuration-cache
|
||||
app/build
|
||||
- name: Use app/build and gradle configuration cache
|
||||
if: ${{ github.ref != 'refs/heads/dev-ose' }}
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
key: app_build-tests-with-emulator
|
||||
key: app_build-tests-without-emulator
|
||||
restore-keys: app_build-tests-without-emulator- # restore cache from dev branch
|
||||
path: |
|
||||
.gradle/configuration-cache
|
||||
app/build
|
||||
|
@ -107,15 +116,6 @@ jobs:
|
|||
disable-animations: true
|
||||
script: ./gradlew app:connectedCheck
|
||||
|
||||
- name: Cache app/build and gradle configuration
|
||||
if: ${{ github.ref == 'refs/heads/dev-ose' }}
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
key: app_build-tests-with-emulator
|
||||
path: |
|
||||
.gradle/configuration-cache
|
||||
app/build
|
||||
|
||||
- name: Archive results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
|
|
Loading…
Reference in a new issue