on: 
  pull_request:
    paths:
      - .github/actions/extism/**
      - .github/workflows/ci-java.yml
      - manifest/**
      - runtime/**
      - libextism/**
      - java/**
  workflow_dispatch:

name: Java CI

jobs:
  java:
    name: Java
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        version: [11, 17]
        rust:
          - stable
    steps:
      - name: Checkout sources
        uses: actions/checkout@v3
      - uses: ./.github/actions/extism
      - name: Set up Java
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: '${{ matrix.version }}'
      - name: Test Java
        run: |
          cd java
          mvn --batch-mode -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn verify

