Skip to content
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
150 changes: 82 additions & 68 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
api-level: [16, 23, 29]
target: [default, google_apis]
arch: [x86]
os: [ macos-latest, ubuntu-latest ]
api-level: [ 16, 23, 29 ]
target: [ default, google_apis ]
arch: [ x86 ]
exclude:
- os: ubuntu-latest
api-level: 23
Expand All @@ -47,73 +47,87 @@ jobs:
arch: x86_64

steps:
- name: checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: build, test and lint
run: |
npm install
npm run build
npm run lint
npm test
- name: Cache Node
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- name: Java 15
uses: actions/setup-java@v1
with:
java-version: 15
- uses: actions/cache@v2
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
~/.android/debug.keystore
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}
- name: Npm build, test and lint
run: |
npm install
npm run build
npm run lint
npm test

- name: assemble tests
uses: gradle/gradle-build-action@v2
with:
build-root-directory: test-fixture
arguments: assembleAndroidTest
- name: Java 15
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 15

- name: run emulator to generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: ./
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Galaxy Nexus
cores: 2
sdcard-path-or-size: 100M
avd-name: test
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
working-directory: ./test-fixture/
channel: canary
script: echo "Generated AVD snapshot for caching."
- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: run action
uses: ./
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Galaxy Nexus
cores: 2
ram-size: 2048M
sdcard-path-or-size: 100M
avd-name: test
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: ./test-fixture/
channel: canary
script: |
echo $GITHUB_REPOSITORY
adb devices
./gradlew connectedDebugAndroidTest
- name: AVD cache
uses: actions/cache@v2
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
~/.android/debug.keystore
key: avd-${{ matrix.api-level }}-${{ matrix.os }}-${{ matrix.target }}

- name: Assemble tests
uses: gradle/gradle-build-action@v2
with:
build-root-directory: test-fixture
arguments: assembleAndroidTest

- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: ./
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Galaxy Nexus
cores: 2
sdcard-path-or-size: 100M
avd-name: test
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
working-directory: ./test-fixture/
channel: canary
script: echo "Generated AVD snapshot for caching."

- name: Run tests
uses: ./
with:
api-level: ${{ matrix.api-level }}
target: ${{ matrix.target }}
arch: ${{ matrix.arch }}
profile: Galaxy Nexus
cores: 2
ram-size: 2048M
sdcard-path-or-size: 100M
avd-name: test
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
working-directory: ./test-fixture/
channel: canary
script: |
echo $GITHUB_REPOSITORY
adb devices
./gradlew connectedDebugAndroidTest
74 changes: 42 additions & 32 deletions .github/workflows/manually.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,18 @@ on:
default: 'default'
arch:
description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a'
required: false
default: 'x86'
emulator-options:
description: 'command-line options used when launching the emulator'
required: false
default: '-no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim'
emulator-build:
required: false
description: 'build number of a specific version of the emulator binary to use'
channel:
description: 'Channel to download the SDK components from - `stable`, `beta`, `dev`, `canary`'
required: false
default: 'stable'
Comment on lines 17 to 31
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

script:
description: 'custom script to run - e.g. `./gradlew connectedCheck`'
Expand All @@ -38,39 +42,45 @@ jobs:
timeout-minutes: 15

steps:
- name: checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: build, test and lint
run: |
npm install
npm run build
npm run lint
npm test
- name: Cache Node
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Java 15
uses: actions/setup-java@v1
with:
java-version: 15
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
- name: Npm build, test and lint
run: |
npm install
npm run build
npm run lint
npm test

- name: run action
uses: ./
with:
api-level: ${{ github.event.inputs.api-level }}
target: ${{ github.event.inputs.target }}
arch: ${{ github.event.inputs.arch }}
profile: Galaxy Nexus
emulator-options: ${{ github.event.inputs.emulator-options }}
emulator-build: ${{ github.event.inputs.emulator-build }}
channel: ${{ github.event.inputs.channel }}
working-directory: ./test-fixture/
script: ${{ github.event.inputs.script }}
- name: Java 15
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 15

- name: Gradle cache
uses: gradle/gradle-build-action@v2

- name: Run tests
uses: ./
with:
api-level: ${{ github.event.inputs.api-level }}
target: ${{ github.event.inputs.target }}
arch: ${{ github.event.inputs.arch }}
profile: Galaxy Nexus
emulator-options: ${{ github.event.inputs.emulator-options }}
emulator-build: ${{ github.event.inputs.emulator-build }}
channel: ${{ github.event.inputs.channel }}
working-directory: ./test-fixture/
script: ${{ github.event.inputs.script }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,6 @@ typings/
# IntelliJ IDEA
.idea
*.iml
local.properties
build
.gradle
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
test:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: run tests
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
Expand All @@ -52,10 +52,10 @@ jobs:
api-level: [21, 23, 29]
target: [default, google_apis]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: run tests
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
Expand All @@ -72,10 +72,10 @@ jobs:
test:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: run tests
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
Expand All @@ -99,8 +99,8 @@ jobs:
matrix:
api-level: [21, 23, 29]
steps:
- name: checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3

- name: Gradle cache
uses: gradle/gradle-build-action@v2
Expand All @@ -114,7 +114,7 @@ jobs:
~/.android/adb*
key: avd-${{ matrix.api-level }}

- name: create AVD and generate snapshot for caching
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -124,7 +124,7 @@ jobs:
disable-animations: false
script: echo "Generated AVD snapshot for caching."

- name: run tests
- name: Run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
Expand Down
1 change: 0 additions & 1 deletion test-fixture/app/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions test-fixture/local.properties

This file was deleted.