name: Test and build

on: [push]

jobs:
  build:
    strategy:
      matrix:
        os: ['ubuntu-latest', 'macos-latest']
        # os: ['ubuntu-20.04', 'ubuntu-18.04', 'ubuntu-16.04', 'macos-latest']
      fail-fast: false
    runs-on: ${{ matrix.os }}

    steps:
    - name: Install Dependencies (Linux)
      run: |
        sudo apt-get update -y
        sudo apt-get install -y devscripts debhelper moreutils fakeroot jq pigz
        wget "https://storage.googleapis.com/shellcheck/shellcheck-v0.7.0.linux.x86_64.tar.xz"
        tar --xz -xvf "shellcheck-v0.7.0.linux.x86_64.tar.xz"
        sudo cp shellcheck-v0.7.0/shellcheck /usr/bin/shellcheck
      if: matrix.os == 'ubuntu-latest'
    - name: Install Dependencies (macOS)
      run: |
        brew install gnu-tar shellcheck jq pigz coreutils gnu-sed gnu-getopt
        brew unlink parallel
        brew install moreutils gawk
      if: matrix.os == 'macos-latest'
    - name: Get Sources
      uses: actions/checkout@v2
    - name: Test
      run: |
        export PATH="$PATH:/snap/bin"
        make test
      shell: bash
    - name: Build (Linux)
      run: DEB_BUILD_OPTIONS=nocheck debuild -us -uc
      if: matrix.os == 'ubuntu-latest'

name: Test and build

on: [push]

jobs:
  build:
    strategy:
      matrix:
        os: ['ubuntu-latest', 'macos-latest']
        # os: ['ubuntu-20.04', 'ubuntu-18.04', 'ubuntu-16.04', 'macos-latest']
      fail-fast: false
    runs-on: ${{ matrix.os }}

    steps:
    - name: Install Dependencies (Linux)
      run: |
        sudo apt-get update -y
        sudo apt-get --purge remove parallel
        sudo apt-get install -y devscripts debhelper moreutils fakeroot jq pigz
        wget "https://storage.googleapis.com/shellcheck/shellcheck-v0.7.0.linux.x86_64.tar.xz"
        tar --xz -xvf "shellcheck-v0.7.0.linux.x86_64.tar.xz"
        sudo cp shellcheck-v0.7.0/shellcheck /usr/bin/shellcheck
      if: matrix.os == 'ubuntu-latest'
    - name: Install Dependencies (macOS)
      run: |
        brew install gnu-tar shellcheck jq pigz coreutils gnu-sed gnu-getopt
        brew unlink parallel
        brew install moreutils gawk
      if: matrix.os == 'macos-latest'
    - name: Get Sources
      uses: actions/checkout@v2
    - name: Test
      run: |
        export PATH="$PATH:/snap/bin"
        make test
      shell: bash
    - name: Build (Linux)
      run: DEB_BUILD_OPTIONS=nocheck debuild -us -uc
      if: matrix.os == 'ubuntu-latest'

Purge parallel so Ubuntu uses moreutils
Purge parallel so Ubuntu uses moreutils
