# build.yml
# Reusable workflow that builds Libation for all platforms.
---
name: build

on:
  workflow_call:
    inputs:
      version_override:
        type: string
        description: "Version number override"
        required: false
      run_unit_tests:
        type: boolean
        description: "Skip running unit tests"
        required: false
        default: true

jobs:
  windows:
    strategy:
      matrix:
        architecture: [x64]
    uses: ./.github/workflows/build-windows.yml
    with:
      version_override: ${{ inputs.version_override }}
      run_unit_tests: ${{ inputs.run_unit_tests }}
      architecture: ${{ matrix.architecture }}

  linux:
    strategy:
      matrix:
        OS: [Redhat, Debian]
        architecture: [x64, arm64]
    uses: ./.github/workflows/build-linux.yml
    with:
      version_override: ${{ inputs.version_override }}
      runs_on: ubuntu-latest
      OS: ${{ matrix.OS }}
      architecture: ${{ matrix.architecture }}
      run_unit_tests: ${{ inputs.run_unit_tests }}

  macos:
    strategy:
      matrix:
        architecture: [x64, arm64]
    uses: ./.github/workflows/build-linux.yml
    with:
      version_override: ${{ inputs.version_override }}
      runs_on: macos-latest
      OS: MacOS
      architecture: ${{ matrix.architecture }}
      run_unit_tests: ${{ inputs.run_unit_tests }}
