on: [push, pull_request]
name: Build
jobs:
  cli:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
    - name: Install Go
      uses: actions/setup-go@v5
      with:
        go-version: stable
    - name: Build
      run: go build -v ./...
      working-directory: cmd/cbconvert
      env:
        CGO_ENABLED: 1

  gui:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
    - name: Install Go
      uses: actions/setup-go@v5
      with:
        go-version: stable
    - name: Install dependencies
      if: runner.os == 'Linux'
      run: sudo apt-get update -y && sudo apt-get install -y libgtk-3-dev
    - name: Build
      run: go build -v ./...
      working-directory: cmd/cbconvert-gui
      env:
        CGO_ENABLED: 1
