name: Build

on:
  push:
    branches:
      - "main"
    paths-ignore:
      - '.gitignore'
      - 'CODEOWNERS'
      - 'LICENSE'
      - '*.md'
      - '*.adoc'
      - '*.txt'
      - '.all-contributorsrc'
  pull_request:
    paths-ignore:
      - '.gitignore'
      - 'CODEOWNERS'
      - 'LICENSE'
      - '*.md'
      - '*.adoc'
      - '*.txt'
      - '.all-contributorsrc'

jobs:
  build:
    name: Build on ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
#        os: [windows-latest, macos-latest, ubuntu-latest]
        os: [ubuntu-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Prepare git
        run: git config --global core.autocrlf false
        if: startsWith(matrix.os, 'windows')

      - uses: actions/checkout@v4
      - name: Set up JDK 17
        uses: actions/setup-java@v4
        with:
          distribution: temurin
          java-version: 17
          cache: 'maven'

      - name: Build with Maven
        run: mvn -B formatter:validate verify --file pom.xml
        env:
          QUARKUS_DISCORD4J_TOKEN: ${{ secrets.QUARKUS_DISCORD4J_TOKEN }}
          QUARKUS_DISCORD4J_GUILD_COMMANDS_TEST_GUILD_ID: ${{ secrets.QUARKUS_DISCORD4J_GUILD_COMMANDS_TEST_GUILD_ID }}