Skip to content

Fix wasNotshould throw exception when called on non mocked object #851

Fix wasNotshould throw exception when called on non mocked object

Fix wasNotshould throw exception when called on non mocked object #851

Workflow file for this run

name: All tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17, 19 ] # test LTS versions, and the newest
kotlin-version: [ 1.5.31, 1.6.21, 1.7.22, 1.8.20, 1.9.10 ]
fail-fast: false # in case one JDK fails, we still want to see results from others
name: "[java=${{ matrix.java-version }}, kotlin=${{ matrix.kotlin-version }}]"
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2.4.2
- name: Run tests with Gradle
run: >
./gradlew check
--stacktrace
-Pio_mockk_kotlin_version=${{ matrix.kotlin-version }}
-Pio_mockk_java_toolchain_test_version=${{ matrix.java-version }}
android-instrumented-tests:
runs-on: macos-latest
strategy:
matrix:
api-level: [ 29 ] # Relevant SDK versions to test for MockK Android projects
fail-fast: false # in case one API-level fails, we still want to see results from others
name: "[api-level=${{ matrix.api-level }}]"
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: ${{ runner.os }}-avd-${{ matrix.api-level }}
- 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-level }}
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: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
script: ./gradlew connectedCheck