name: Haskell CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Install Stack
      run: |
        mkdir -p ~/.local/bin
        curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
    - name: Install Stack GHC
      run: ~/.local/bin/stack setup
    - name: Install dependencies
      run: ~/.local/bin/stack build --only-dependencies
    - name: Test
      run: ~/.local/bin/stack test

name: Haskell CI

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Install Stack
      run: |
        mkdir -p ~/.local/bin
        curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
    - name: Install Stack GHC
      run: ~/.local/bin/stack setup
    - name: Install dependencies
      run: ~/.local/bin/stack build --only-dependencies
    - name: Test
      run: ~/.local/bin/stack test
    - name: Copy binary to .github
      run: find .stack-work -name mat-chalmers -type f -exec mv '{}' .github/mat-chalmers-linux-x86_64 ';'
    - uses: actions/upload-artifact@master
      if: "github.ref == 'refs/heads/master'"
      with:
        name: mat-chalmers
        path: .github/mat-chalmers-linux-x86_64

Make built binary downloadable from master branch
Make built binary downloadable from master branch

When the action pipeline is triggered on the master branch, we'll put
the built binary as a downloadable artifact.
