name: Test

on:
  workflow_dispatch:

jobs:
  build-linux:
    name: Build and test linux
    runs-on: ubuntu-latest
    env:
      RELEASE_OS: linux
    steps:
      - name: checkout branch
        uses: actions/checkout@master
      - name: Setup environment
        id: setup
        run: echo ::set-output name=RELEASE_VERSION::${GITHUB_REF##*/}
      - name: make
        run: |
          cd ext/htslib && autoheader && autoconf && cd ../..
          mkdir build && cd build && cmake .. -DBUILD_FUNCTESTING=ON && make && make install && cd ..
      - name: Setup bustools
        run: |
          git clone https://github.com/BUStools/bustools.git
          cd bustools && mkdir build && cd build && cmake .. && make && make install && cd ../..
      - name: Functional testing
        run: |
          cd build && make test
