Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize CI a bit #232

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 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
140 changes: 72 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,77 @@ 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: build, test and lint
run: |
npm install
npm run build
npm run lint
npm test

Goooler marked this conversation as resolved.
Show resolved Hide resolved
- 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: Java 15
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 15
- name: Gradle cache
uses: gradle/gradle-build-action@v2
- 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: assemble tests
uses: gradle/gradle-build-action@v2
with:
build-root-directory: test-fixture
arguments: assembleAndroidTest

- 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: 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: 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: 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
65 changes: 33 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,36 @@ 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: build, test and lint
run: |
npm install
npm run build
npm run lint
npm test

- 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: Java 15
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 15
- name: Gradle cache
uses: gradle/gradle-build-action@v2

- 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: 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 }}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -53,7 +53,7 @@ jobs:
target: [default, google_apis]
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -73,7 +73,7 @@ jobs:
runs-on: macos-latest
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: run tests
uses: reactivecircus/android-emulator-runner@v2
Expand All @@ -100,7 +100,7 @@ jobs:
api-level: [21, 23, 29]
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

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