name: Java Tests

on:
  push:
    branches:
      - main
    tags:
      - v*
  pull_request:
    branches:
      - main

env:
  working-directory: bindings/java

jobs:
  test:
    runs-on: ubuntu-latest

    defaults:
      run:
        working-directory: ${{ env.working-directory }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Install Rust(stable)
        uses: dtolnay/rust-toolchain@stable

      - name: Set up JDK
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: '8'

      - name: Run Java tests
        run: make test
