Skip to content

Commit

Permalink
feature(ci): update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Malinskiy committed Jan 22, 2024
1 parent f96d9cd commit 39a788b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 39 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/test-macos.yml

This file was deleted.

34 changes: 32 additions & 2 deletions .github/workflows/test-linux.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Test Linux"
name: "Test"
on: [push, pull_request]
jobs:
test:
test-ubuntu-latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down Expand Up @@ -36,3 +36,33 @@ jobs:
with:
name: logcat
path: artifacts/logcat.log
test-macos-12:
runs-on: macOS-12
steps:
- uses: actions/checkout@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: test install-sdk
run: npm config delete prefix && source ~/.nvm/nvm.sh && nvm install v16.15.0 && npm install && npm ci && npm run build
working-directory: install-sdk
- name: test emulator-run-cmd
run: npm config delete prefix && source ~/.nvm/nvm.sh && nvm install v16.15.0 && npm install && npm ci && npm run build
working-directory: emulator-run-cmd
- uses: ./install-sdk
name: install sdk
- run: sdkmanager platform-tools
- run: adb devices
- uses: ./emulator-run-cmd
with:
api: 25
tag: default
abi: x86
cmd: adb shell getprop
bootTimeout: 500
- uses: actions/upload-artifact@v1
with:
name: logcat
path: artifacts/logcat.log
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a collection of GitHub Actions for Android development

# Requirements

This is only tested with **macOS-10.15** environment. It might work on linux but there is no support for kvm there so don't expect to have api 26+ available there.
Tested with **macOS-12** and **ubuntu-latest** runner images. It might work using other runners (including self-hosted ones) but there is no support for them.

## Android SDK
This repo provides an action for installing the Android SDK on the build agent. It will override whatever setup is
Expand All @@ -18,7 +18,7 @@ steps:
- uses: actions/checkout@v1

# Download & install the Android SDK.
- uses: malinskiy/action-android/install-sdk@release/0.1.3
- uses: malinskiy/action-android/install-sdk@release/0.1.6

# Set up platform tools like adb.
- run: sdkmanager platform-tools
Expand All @@ -38,14 +38,23 @@ I suggest to use `./gradlew` to minimize the dependency on environment setup.
`action-android/emulator-run-cmd` provide an action which installs the emulator packages, starts the emulator and waits
until it's booted. After this it will execute the provided cmd and stop the running emulator.

It's imperative(!) to use `runs-on: macOS-10.15` if you want to have hardware acceleration for your emulator.
It's imperative(!) to use `runs-on: ubuntu-latest` with KVM enabled or `runs-on: macOS-12` if you want to have hardware acceleration for your emulator.

### Enabling KVM for ubunut-latest
```
- 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
```
### Usage
```yaml
steps:
- uses: actions/checkout@v1
- uses: malinskiy/action-android/emulator-run-cmd@release/0.1.3
- uses: malinskiy/action-android/emulator-run-cmd@release/0.1.6
with:
cmd: ./gradlew integrationTest
api: 25
Expand Down

0 comments on commit 39a788b

Please sign in to comment.