Skip to content

Commit

Permalink
Fix build break of Android test
Browse files Browse the repository at this point in the history
Signed-off-by: kexuan.yang <kexuan.yang@gmail.com>
  • Loading branch information
yangkx1024 committed Apr 29, 2024
1 parent d4b8c4a commit 735629f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 29 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/android-publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: Publish Android package
on:
release:
types: [published]
on:
release:
types: [ published ]

jobs:
build:
jobs:
build:
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@v4

- name: set up JDK 17
uses: actions/setup-java@v3
with:
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Decode Keystore
env:
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
run: |
echo ${ENCODED_KEYSTORE} | base64 -d > ./android/app/keystore.jks
echo ${GPG_SECRET} | base64 -d | gpg --dearmor > ./android/secret.gpg
- name: Android publish
env:
env:
SIGN_KEY_STORE_PATH: keystore.jks
SIGN_STORE_PASSWORD: ${{ secrets.SIGN_STORE_PASSWORD }}
SIGN_KEY_ALIAS: ${{ secrets.SIGN_KEY_ALIAS }}
Expand Down
39 changes: 35 additions & 4 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,47 @@ on:
jobs:
build:

runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Enable KVM
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: set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
distribution: "temurin"
cache: 'gradle'

- name: AVD cache
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-34

- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
arch: x86_64
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: echo "Generated AVD snapshot for caching."

- name: Prepare Gradle build
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE }}
Expand All @@ -43,6 +72,8 @@ jobs:
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 34
target: google_apis_playstore
arch: x86_64
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: cd ./android; ./gradlew connectedAndroidTest
16 changes: 8 additions & 8 deletions .github/workflows/rust-publish.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: Publish Rust package
on:
release:
types: [published]
on:
release:
types: [ published ]

env:
env:
CARGO_TERM_COLOR: always

jobs:
build:
jobs:
build:
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@v4
- name: Cargo publish
run: cargo publish --token ${CARGO_REGISTRY_TOKEN}
env:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
14 changes: 7 additions & 7 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Swift Test

on:
push:
on:
push:
branches: [ "main", "develop" ]
pull_request:
pull_request:
branches: [ "main", "develop" ]

jobs:
build:
jobs:
build:

runs-on: macos-latest

steps:
- uses: swift-actions/setup-swift@v1
steps:
- uses: swift-actions/setup-swift@v2
- uses: actions/checkout@v4
- name: Build
run: |
Expand Down

0 comments on commit 735629f

Please sign in to comment.