name: Build

on:
  push:
  pull_request:
  workflow_dispatch:
  schedule:
    - cron: 0 20 * * *


jobs:
  build_windows:
    name: Windows
    runs-on: windows-latest
    steps:
      - uses: laytan/setup-odin@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          release: false
          
      - uses: actions/checkout@v4

      - name: minimal
        run: odin build examples/minimal -vet -strict-style

      - name: minimal (debug)
        run: odin build examples/minimal -vet -strict-style -debug

      - name: minimal (gl)
        run: odin build examples/minimal -vet -strict-style -define:KARL2D_RENDER_BACKEND=gl

      - name: minimal (gl, debug)
        run: odin build examples/minimal -vet -strict-style -debug -define:KARL2D_RENDER_BACKEND=gl

      - name: snake
        run: odin build examples/snake -vet -strict-style

      - name: snake (debug)
        run: odin build examples/snake -vet -strict-style -debug

      - name: 2d_camera
        run: odin build examples/raylib_ports/2d_camera -vet -strict-style

      - name: 2d_camera (debug)
        run: odin build examples/raylib_ports/2d_camera -vet -strict-style -debug

      - name: shaders_texture_waves
        run: odin build examples/raylib_ports/shaders_texture_waves -vet -strict-style

      - name: shaders_texture_waves (debug)
        run: odin build examples/raylib_ports/shaders_texture_waves -vet -strict-style -debug

      - name: gamepad
        run: odin build examples/gamepad -vet -strict-style

      - name: gamepad (debug)
        run: odin build examples/gamepad -vet -strict-style -debug
