Skip to content

Commit

Permalink
Setup GitHub Actions workflow to build and test lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Duy Phạm authored and Duy Phạm committed Nov 7, 2024
1 parent c17f27b commit d08b0a8
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Test

on:
push:
branches:
- 'task/**'
- 'bug/**'
- 'fix/**'
- 'epic/**'

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

- name: Chmod permissions
run: sudo chmod +x ./gradlew

- name: Setup Gradle Cache
uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
cache-read-only: false

- name: Run Instrumental tests
run: ./gradlew lib:pixel7api34DebugAndroidTest
-Pandroid.experimental.testOptions.managedDevices.emulator.showKernelLogging=true
-Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"
-Pandroid.experimental.androidTest.numManagedDeviceShards=1
-Pandroid.experimental.testOptions.managedDevices.maxConcurrentDevices=1
--max-workers=1

- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: lib/build/outputs/androidTest-results
8 changes: 4 additions & 4 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ android {
testOptions {
managedDevices {
localDevices {
create("pixel2api30") {
create("pixel7api34") {
// Use device profiles you typically see in Android Studio.
device = "Pixel 2"
device = "Pixel 7"
// Use only API levels 27 and higher.
apiLevel = 30
apiLevel = 34
// To include Google services, use "google".
systemImageSource = "aosp"
systemImageSource = "aosp-atd"
}
}
}
Expand Down

0 comments on commit d08b0a8

Please sign in to comment.