name: Build and Test

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build-linux:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        distro:
          - fedora
          - debian
      fail-fast: false

    steps:
      - uses: actions/checkout@v2
      - run: docker build -t libgusb-${{ matrix.distro }} -f contrib/ci/Dockerfile-${{ matrix.distro }} .
      - run: docker run -t -v `pwd`:/build libgusb-${{ matrix.distro }} ./contrib/ci/build_and_test.sh -Dtests=false

  build-freebsd:
    runs-on: macos-10.15

    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Build
      id: test
      uses: vmactions/freebsd-vm@v0.1.5
      with:
        usesh: true
        mem: 8192
        prepare: |
          pkg install -y git python3 glib json-glib meson pkgconf gobject-introspection usbids
        sync: rsync
        run: ./contrib/ci/build_and_test.sh -Dvapi=false -Ddocs=false -Dusb_ids=/usr/local/share/usbids/usb.ids

name: Build and Test

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  build-linux:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        distro:
          - fedora
          - debian
      fail-fast: false

    steps:
      - uses: actions/checkout@v2
      - run: docker build -t libgusb-${{ matrix.distro }} -f contrib/ci/Dockerfile-${{ matrix.distro }} .
      - run: docker run -t -v `pwd`:/build libgusb-${{ matrix.distro }} ./contrib/ci/build_and_test.sh -Dtests=false

  build-freebsd:
    runs-on: macos-12

    steps:
    - name: Checkout
      uses: actions/checkout@v2
    - name: Build
      id: test
      uses: vmactions/freebsd-vm@v0.2.6
      with:
        usesh: true
        mem: 8192
        prepare: |
          pkg install -y git python3 glib json-glib meson pkgconf gobject-introspection usbids
        sync: rsync
        run: ./contrib/ci/build_and_test.sh -Dvapi=false -Ddocs=false -Dusb_ids=/usr/local/share/usbids/usb.ids

Update to non-deprecated macos-12 CI target
trivial: Update to non-deprecated macos-12 CI target
