mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Update CI with latest versions, artifacts and caching (#4785)
* Auto generate apk after build is complete * Add cache * Fix syntax error * Fix syntax error * Fix artifact name not valid error
This commit is contained in:
parent
ff8f067841
commit
49274c5dbd
1 changed files with 46 additions and 13 deletions
49
.github/workflows/android.yml
vendored
49
.github/workflows/android.yml
vendored
|
|
@ -8,18 +8,51 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-18.04
|
name: Build APK and Run Unit Tests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2.4.0
|
||||||
- name: set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v2.5.0
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
distribution: "temurin"
|
||||||
- name: Build with Gradle
|
java-version: 8
|
||||||
run: ./gradlew -Pcoverage testBetaDebugUnitTestCoverage
|
|
||||||
- name: Upload Test Report
|
- name: Cache packages
|
||||||
|
id: cache-packages
|
||||||
|
uses: actions/cache@v2.1.7
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
|
||||||
|
restore-keys: gradle-packages-${{ runner.os }}
|
||||||
|
|
||||||
|
- name: Build with Gradle and run Unit Tests
|
||||||
|
run: ./gradlew -Pcoverage testBetaDebugUnitTestCoverage --stacktrace
|
||||||
|
|
||||||
|
- name: Upload Test Report to Codecov
|
||||||
run: |
|
run: |
|
||||||
curl -Os https://uploader.codecov.io/latest/linux/codecov
|
curl -Os https://uploader.codecov.io/latest/linux/codecov
|
||||||
chmod +x codecov
|
chmod +x codecov
|
||||||
./codecov -f "app/build/reports/jacoco/testBetaDebugUnitTestCoverage/testBetaDebugUnitTestCoverage.xml" -Z
|
./codecov -f "app/build/reports/jacoco/testBetaDebugUnitTestCoverage/testBetaDebugUnitTestCoverage.xml" -Z
|
||||||
|
|
||||||
|
- name: Generate betaDebug APK
|
||||||
|
run: bash ./gradlew assembleBetaDebug --stacktrace
|
||||||
|
|
||||||
|
- name: Upload betaDebug APK
|
||||||
|
uses: actions/upload-artifact@v2.3.1
|
||||||
|
with:
|
||||||
|
name: betaDebugAPK
|
||||||
|
path: app/build/outputs/apk/beta/debug/app-*.apk
|
||||||
|
|
||||||
|
- name: Generate prodDebug APK
|
||||||
|
run: bash ./gradlew assembleProdDebug --stacktrace
|
||||||
|
|
||||||
|
- name: Upload prodDebug APK
|
||||||
|
uses: actions/upload-artifact@v2.3.1
|
||||||
|
with:
|
||||||
|
name: prodDebugAPK
|
||||||
|
path: app/build/outputs/apk/prod/debug/app-*.apk
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue