Complete the code to specify the event that triggers the GitHub Actions workflow on every push.
on: [1]The push event triggers the workflow whenever code is pushed to the repository.
Complete the code to specify the job runs on an Ubuntu virtual machine.
jobs:
build:
runs-on: [1]The ubuntu-latest label runs the job on the latest Ubuntu virtual environment.
Fix the error in the step that checks out the repository code.
steps:
- name: Checkout code
uses: [1]The latest stable version of the checkout action is actions/checkout@v3, which ensures compatibility and new features.
Fill both blanks to set up Java and cache Gradle dependencies.
steps:
- uses: actions/setup-java@v3
with:
java-version: [1]
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: gradle-[2]Java version 17 is the current LTS for Android builds. Using runner.os in the cache key helps create OS-specific cache keys.
Fill all three blanks to build the Android app using Gradle and upload the APK artifact.
steps: - name: Build with Gradle run: ./gradlew [1] assemble[2] - name: Upload APK uses: actions/upload-artifact@v2 with: name: app-release path: app/build/outputs/apk/[3]/app-release.apk
Running clean ensures a fresh build. The task assembleRelease builds the release APK. The path uses the 'release' folder for the APK.