name: generic-release

on:
  pull_request:
    # This will eventually only be for pushes to release
    # but for dogfooding purposes, I'm running it even
    # on dev pushes
    branches: [ dev, release, actionsTest ]

jobs:
  # missing jobs
  #
  # ppc64le + fuzz test
  # Qemu PPC64 + Fuzz test
  # Qemu aarch64 + Fuzz Test (on Xenial)
  # versions comp
  # meson test

  osx:
    runs-on: macos-10.15
    steps:
    - uses: actions/checkout@v2
    - name: OS-X
      run: |
        make test
        # make -c lib all (need to fix. not working right now)

  zbuff:
    runs-on: ubuntu-16.04
    steps:
    - uses: actions/checkout@v2
    - name: zbuff test
      run: |
        make -C tests test-zbuff

  tsan:
    runs-on: ubuntu-16.04
    steps:
    - uses: actions/checkout@v2
    - name: thread sanitizer
      run: |
        sudo apt-add-repository "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.8 main"
        sudo apt-get update
        sudo apt-get install clang-3.8
        CC=clang-3.8 make tsan-test-zstream
        CC=clang-3.8 make tsan-fuzztest

  zlib-wrapper:
    runs-on: ubuntu-16.04
    steps:
    - uses: actions/checkout@v2
    - name: zlib wrapper test
      run: |
        make gpp6install valgrindinstall
        make -C zlibWrapper test
        make -C zlibWrapper valgrindTest

  lz4-threadpool-partial-libs:
    runs-on: ubuntu-16.04
    steps:
    - uses: actions/checkout@v2
    - name: LZ4, thread pool, and partial libs testslib wrapper test
      run: |
        make lz4install
        make -C tests test-lz4
        make check < /dev/null | tee   # mess with lz4 console detection
        make clean
        make -C tests test-pool
        make clean
        bash tests/libzstd_partial_builds.sh
