Merge pull request #8 from LeoAndo/LeoAndo-patch-1 #22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Android CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
# https://github.com/styfle/cancel-workflow-action#usage | |
- name: Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.11.0 | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v3 | |
- name: set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
# gradle cache | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: Run lint for lint the variants. | |
run: ./gradlew lint | |
#- name: Run unit tests for testDebugUnitTest the variants. | |
# run: ./gradlew testDebugUnitTest | |
- name: Build tasks (Assemble main outputs for assembleDebug the variants.) | |
run: | | |
./gradlew assembleDebug | |
# https://github.com/android/nowinandroid/blob/main/.github/workflows/Build.yaml | |
- name: Upload build outputs (APKs) | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-outputs | |
path: app/build/outputs | |
- name: Upload build reports | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-reports | |
path: app/build/reports |