Skip to content

Commit

Permalink
Added instrumentation test and CI config.
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Mar 14, 2024
1 parent 6d3a0b1 commit 11d6971
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,36 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: error-report
path: build-reports.zip
path: build-reports.zip

instrumentation-tests:
name: Instrumentation tests
runs-on: macos-latest
timeout-minutes: 20
strategy:
# Allow tests to continue on other devices if they fail on one device.
fail-fast: false
matrix:
api-level:
- 29
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7 # v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true

- name: Instrumentation Tests
uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2
with:
api-level: ${{ matrix.api-level }}
target: default
arch: x86_64
script: ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace

- name: Upload results
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
with:
name: insrumentation-test-results
path: ./**/build/reports/androidTests/connected/**
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.handstandsam.shoppingapp.tests

import org.junit.Test

class Test {

@Test
fun testException() {
throw RuntimeException("Test Exception!")
}

@Test
fun testSuccess() {
throw RuntimeException("Test Success!")
}

}

0 comments on commit 11d6971

Please sign in to comment.