Skip to content

android: add cache for gradle and avd #7

android: add cache for gradle and avd

android: add cache for gradle and avd #7

Workflow file for this run

name: android
on:
push:
branches:
- 'android'
paths:
- 'action.yml'
- '.github/workflows/android_test.yml'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
id: go
- uses: gradle/gradle-build-action@v2
id: avd-cache
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
uses: actions/cache@v4
id: avd-cache

Check failure on line 35 in .github/workflows/android_test.yml

View workflow run for this annotation

GitHub Actions / android

Invalid workflow file

The workflow is not valid. .github/workflows/android_test.yml (Line: 35, Col: 11): The identifier 'avd-cache' may not be used more than once within the same scope.
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-29
- name: Load emulator and smoke test
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: ./gradlew connectedCheck
- name: Build go from tip
uses: iwdgo/gotip-build@android
id: gotip
with:
go_variables: GOOS=android GOARCH=amd64 CGO_ENABLED=1
test_build: true
- name: Upload go executable
uses: actions/upload-artifact@v3
if: ${{ env.crosscompile == 'false' }}
with:
name: gotip-${{ env.goos }}-${{ env.goarch }}
path: go/
- name: Upload go executable
uses: actions/upload-artifact@v3
if: ${{ env.crosscompile == 'true' }}
with:
name: gotip-${{ env.goos }}-${{ env.goarch }}
path: go/bin/${{ env.goos }}_${{ env.goarch }}