diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml new file mode 100644 index 0000000..a1c07ce --- /dev/null +++ b/.github/workflows/pr_tests.yml @@ -0,0 +1,36 @@ +# Runs the unit tests on every pull request (and on pushes to main). +# These tests are native-free (they use a fake CMMCore), so they run on a +# stock CI runner without the MMCoreJ native library. The native-dependent +# TestAcquisitionEvent is excluded via the maven-surefire-plugin config in +# pom.xml. + +name: PR tests + +on: + pull_request: + push: + branches: + - main + +# Cancel an in-progress run if a new commit is pushed to the same ref. +concurrency: + group: pr-tests-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Run Maven tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: 'zulu' + cache: maven + + - name: Run tests + run: mvn --batch-mode test