diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c57e59086..6ea135eac2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,38 @@ jobs: chmod +x codecov ./codecov + # + # Android build job + # + android: + runs-on: macos-latest + if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" + + # Definition of the build matrix + strategy: + matrix: + java: [ 11 ] + android-api: [ 26 ] + + # All build steps + steps: + - name: 1. Check out code + uses: actions/checkout@v3 + with: + fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci + + - name: 2. Set up Java ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + + - name: 3. Run Android tests on Java ${{ matrix.java }} with Android API level ${{ matrix.android-api }} + uses: reactivecircus/android-emulator-runner@v2 + with: + arch: x86_64 + api-level: ${{ matrix.android-api }} + script: ./gradlew :androidTest:connectedCheck --no-daemon --no-build-cache # # Release job, only for pushes to the main development branch diff --git a/subprojects/androidTest/src/androidTest/java/org/mockitousage/androidtest/BasicInstrumentedTests.kt b/subprojects/androidTest/src/androidTest/java/org/mockitousage/androidtest/BasicInstrumentedTests.kt index 2fa04c8bd6..07378171fc 100644 --- a/subprojects/androidTest/src/androidTest/java/org/mockitousage/androidtest/BasicInstrumentedTests.kt +++ b/subprojects/androidTest/src/androidTest/java/org/mockitousage/androidtest/BasicInstrumentedTests.kt @@ -35,7 +35,6 @@ class BasicInstrumentedTests { fun mockAndUseBasicClassUsingAnnotatedMock() { val basicClass = BasicOpenClassReceiver(mockedViaAnnotationBasicOpenClass) basicClass.callDependencyMethod() - throw Exception("java") } @Test