Where to setup Android SDK in a typical Github Actions workflow? - Stack Overflow

Here is a normal test_and_apk job in Build workflow of nowinandroid repo.jobs:test_and_apk:name: "

Here is a normal test_and_apk job in Build workflow of nowinandroid repo.

jobs:
  test_and_apk:
    name: "Local tests and APKs"
    runs-on: ubuntu-latest

    permissions:
      contents: write
      pull-requests: write
      security-events: write

    timeout-minutes: 60

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Copy CI gradle.properties
        run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

      - name: Set up JDK 17
        uses: actions/setup-java@v4
        with:
          distribution: 'zulu'
          java-version: 17

      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@v4
        with:
          cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

      - name: Run local tests
        run: ./gradlew testDemoDebug

      - name: Build all build type and flavor permutations
        run: ./gradlew :app:assemble

I'm so surprised there is no place to call android-actions/setup-android@v3. But finally it's able to run test and build the Android app.

Does it mean the ubuntu-latest contains the Android SDK already? Or gradle/actions/setup-gradle also download Android SDK (uhm, I don't think so). Can anyone explain it to me?

Here is a normal test_and_apk job in Build workflow of nowinandroid repo.

jobs:
  test_and_apk:
    name: "Local tests and APKs"
    runs-on: ubuntu-latest

    permissions:
      contents: write
      pull-requests: write
      security-events: write

    timeout-minutes: 60

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Copy CI gradle.properties
        run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

      - name: Set up JDK 17
        uses: actions/setup-java@v4
        with:
          distribution: 'zulu'
          java-version: 17

      - name: Setup Gradle
        uses: gradle/actions/setup-gradle@v4
        with:
          cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}

      - name: Run local tests
        run: ./gradlew testDemoDebug

      - name: Build all build type and flavor permutations
        run: ./gradlew :app:assemble

I'm so surprised there is no place to call android-actions/setup-android@v3. But finally it's able to run test and build the Android app.

Does it mean the ubuntu-latest contains the Android SDK already? Or gradle/actions/setup-gradle also download Android SDK (uhm, I don't think so). Can anyone explain it to me?

Share Improve this question asked Mar 25 at 9:14 anticafeanticafe 6,9249 gold badges47 silver badges79 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Android SDK is included in the VM image (in your case ubuntu-latest) and the SDK path is set by ANDROID_HOME as an environment variable.

You can see all the preinstalled software and environment variable here

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744207256a4563163.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信