name: Tests
on: [push]

jobs:
  test:
    strategy:
      matrix:
        java-version: ["11", "17", "21"]
        os: [ubuntu-latest, macOS-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Prepare java
        uses: actions/setup-java@v4
        with:
          distribution: "adopt"
          java-version: ${{ matrix.java-version }}

      - name: Setup Clojure
        uses: DeLaGuardo/setup-clojure@12.5
        with:
          cli: latest

      - name: Checkout
        uses: actions/checkout@v4

      - name: Run tests not Windows
        if: ${{ matrix.os != 'windows-latest' }}
        run: clojure -X:test
        shell: bash

      - name: Run tests on Windows
        if: ${{ matrix.os == 'windows-latest' }}
        run: clojure -X:test
        shell: powershell
