Add GitHub Actions CI.

This commit is contained in:
David Perez
2023-01-12 08:48:31 -06:00
parent 77e47249c8
commit 52cc1da711
4 changed files with 105 additions and 0 deletions

86
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,86 @@
name: CI
on:
pull_request:
env:
RUBY_VERSION: 2.7.2
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version:
- 8
api-version:
- 22
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Prepare Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -fr ~/.gradle/caches/*/plugin-resolution/
- name: Cache Gradle Files
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: v1-${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
restore-keys: |
v1-${{ runner.os }}-gradle-${{ matrix.java-version }}-
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-version }}
- 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: ${{ matrix.api-version }}
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Configure Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
bundler-cache: true
- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
- name: Connected Tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-version }}
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: |
adb uninstall com.livefront.bridgesample
./gradlew connectedAndroidTest
- name: Unit Tests
run: ./gradlew testReleaseUnitTest

1
.ruby-version Normal file
View File

@@ -0,0 +1 @@
2.7.2

4
Gemfile Normal file
View File

@@ -0,0 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"
ruby "2.7.2"

14
Gemfile.lock Normal file
View File

@@ -0,0 +1,14 @@
GEM
remote: https://rubygems.org/
specs:
PLATFORMS
ruby
DEPENDENCIES
RUBY VERSION
ruby 2.7.2p137
BUNDLED WITH
2.3.18