Update ci.yml #195
This file contains hidden or 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/[email protected] | |
| with: | |
| access_token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/checkout@v4 | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Create local.properties | |
| env: | |
| MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }} | |
| run: | | |
| echo "MAPS_API_KEY=$MAPS_API_KEY" >> local.properties | |
| # gradle cache | |
| - uses: actions/cache@v4 | |
| 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@v4 | |
| with: | |
| name: build-outputs | |
| path: app/build/outputs | |
| - name: Upload build reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-reports | |
| path: app/build/reports |