name: nvme-cli meson CI

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

  workflow_dispatch:

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

    steps:
      - name: install libraries
        run: sudo apt-get install libjson-c-dev libhugetlbfs-dev
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.x'
      # - name: install python dependencies
      #   run: |
      #     python -m pip install --upgrade pip
      #     pip install nose nose2
      - uses: BSFishy/meson-build@v1.0.3
        with:
          setup-options: --werror
          action: build

  build-fallback:
    runs-on: ubuntu-latest
    steps:
      - name: install libraries
        run: sudo apt-get install -y libpam-dev libcap-ng-dev
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.x'
      - uses: BSFishy/meson-build@v1.0.3
        with:
          setup-options: --werror -Duuid:werror=false --wrap-mode=forcefallback
          options: --verbose
          action: build
          meson-version: 0.61.2

  build-static:
    runs-on: ubuntu-latest
    steps:
      - name: install libraries
        run: sudo apt-get install -y libpam-dev libcap-ng-dev
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: '3.x'
      - uses: BSFishy/meson-build@v1.0.3
        with:
          setup-options: --werror -Duuid:werror=false --wrap-mode=forcefallback --default-library=static
          options: --verbose
          action: build
          meson-version: 0.61.2
