1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2024-09-19 22:49:08 -05:00

Github workflow config improvements (#1056)

This commit is contained in:
Mikołaj Pich 2020-12-28 22:45:21 +01:00 committed by GitHub
parent 7fe638130e
commit 5a2a0e3d6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 10 deletions

View File

@ -28,9 +28,9 @@ jobs:
~/.gradle/wrapper ~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }} key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
- name: Build - name: Build
run: ./gradlew compileFdroidDebugUnitTestKotlin packageFdroidDebug preFdroidDebugAndroidTestBuild run: ./gradlew --build-cache compileFdroidDebugUnitTestKotlin preFdroidDebugAndroidTestBuild dexBuilderFdroidDebugAndroidTest packageFdroidDebug packageFdroidDebugAndroidTest
- name: Prepare build cache - name: Prepare build cache
run: tar -cvf prebuild.tar .gradle app/build run: tar -cf prebuild.tar .build-cache .gradle app/build
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: prebuild.tar name: prebuild.tar
@ -56,18 +56,18 @@ jobs:
with: with:
name: prebuild.tar name: prebuild.tar
- name: Extract build cache - name: Extract build cache
run: tar -xvf prebuild.tar app/build run: tar -xf prebuild.tar
- name: Unit tests - name: Unit tests
run: | run: |
./gradlew -Pcoverage testFdroidDebugUnitTest --stacktrace ./gradlew --build-cache -Pcoverage testFdroidDebugUnitTest --stacktrace
./gradlew -Pcoverage jacocoTestReport --stacktrace ./gradlew --build-cache -Pcoverage jacocoTestReport --stacktrace
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v1
with: with:
flags: unit flags: unit
instrumentation-tests: instrumentation-tests:
name: Instrumentation tests name: Instrumentation tests
runs-on: ubuntu-latest runs-on: macOS-latest
timeout-minutes: 15 timeout-minutes: 15
needs: [ build ] needs: [ build ]
strategy: strategy:
@ -89,15 +89,15 @@ jobs:
with: with:
name: prebuild.tar name: prebuild.tar
- name: Extract build cache - name: Extract build cache
run: tar -xvf prebuild.tar app/build run: tar -xf prebuild.tar
- name: Instrumentation tests - name: Instrumentation tests
uses: reactivecircus/android-emulator-runner@v2.13.0 uses: reactivecircus/android-emulator-runner@v2.13.0
with: with:
api-level: ${{ matrix.api-level }} api-level: ${{ matrix.api-level }}
arch: x86 arch: x86
script: | script: |
./gradlew -Pcoverage connectedFdroidDebugAndroidTest --stacktrace ./gradlew --build-cache -Pcoverage connectedFdroidDebugAndroidTest --stacktrace
./gradlew -Pcoverage jacocoTestReport --stacktrace ./gradlew --build-cache -Pcoverage jacocoTestReport --stacktrace
- uses: codecov/codecov-action@v1 - uses: codecov/codecov-action@v1
with: with:
flags: instrumented,api-${{ matrix.api-level }} flags: instrumented,api-${{ matrix.api-level }}
@ -124,7 +124,7 @@ jobs:
with: with:
name: prebuild.tar name: prebuild.tar
- name: Extract build cache - name: Extract build cache
run: tar -xvf prebuild.tar app/build run: tar -xf prebuild.tar
- name: Decrypt keys - name: Decrypt keys
env: env:
ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }} ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }}

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ out/
# Gradle files # Gradle files
.gradle/ .gradle/
build/ build/
.build-cache
# Local configuration file (sdk path, etc) # Local configuration file (sdk path, etc)
local.properties local.properties

View File

@ -1 +1,8 @@
include ':app' include ':app'
buildCache {
local {
directory = new File(rootDir, '.build-cache')
removeUnusedEntriesAfterDays = 30
}
}