name: Check

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        os: [ubuntu-20.04, macOS-10.15, windows-2019]
        java-version: ["21"]

    steps:
    - uses: actions/checkout@v4
    - name: Set up JDK for x64
      uses: actions/setup-java@v3
      with:
        java-version: ${{ matrix.java-version }}
        distribution: 'temurin'
        architecture: x64

    - name: Build with Maven
      run: mvn clean install -Dmaven.test.skip=true

    - name: Run style checks
      run: mvn spotless:check
