0
0
Android Kotlinmobile~10 mins

CI/CD with GitHub Actions in Android Kotlin - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the event that triggers the GitHub Actions workflow on every push.

Android Kotlin
on: [1]
Drag options to blanks, or click blank then click option'
Apull_request
Bpush
Crelease
Dschedule
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pull_request' instead of 'push' triggers workflow on pull requests, not pushes.
2fill in blank
medium

Complete the code to specify the job runs on an Ubuntu virtual machine.

Android Kotlin
jobs:
  build:
    runs-on: [1]
Drag options to blanks, or click blank then click option'
Aubuntu-latest
Bwindows-latest
Cmacos-latest
Dandroid-latest
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'windows-latest' or 'macos-latest' will run on different OS, not Ubuntu.
3fill in blank
hard

Fix the error in the step that checks out the repository code.

Android Kotlin
steps:
  - name: Checkout code
    uses: [1]
Drag options to blanks, or click blank then click option'
Aactions/setup-java@v3
Bactions/checkout@v1
Cactions/checkout@v3
Dactions/upload-artifact@v2
Attempts:
3 left
💡 Hint
Common Mistakes
Using older versions like v1 may lack features or cause errors.
4fill in blank
hard

Fill both blanks to set up Java and cache Gradle dependencies.

Android Kotlin
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]
Drag options to blanks, or click blank then click option'
A17
B${{ runner.os }}
C11
Dgradle-cache
Attempts:
3 left
💡 Hint
Common Mistakes
Using Java 11 may work but 17 is recommended. Using a static cache key can cause cache conflicts.
5fill in blank
hard

Fill all three blanks to build the Android app using Gradle and upload the APK artifact.

Android Kotlin
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
Drag options to blanks, or click blank then click option'
Aclean
BRelease
Crelease
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Debug' instead of 'Release' builds a debug APK, not suitable for release.