name: Go
on: [push, pull_request]
jobs:

  test:
    name: Test
    runs-on: ubuntu-latest
    steps:

    - name: Setup Go
      uses: actions/setup-go@v1
      with:
        go-version: 1.16
      id: go

    - name: Check out code into the Go module directory
      uses: actions/checkout@v1

    - name: Test
      run: go test ./...

    - run: mkdir -p ./bin/tools

    - name: Build tools
      run: go build -o ./bin/tools ./examples/...
      
    - name: Upload tools
      uses: actions/upload-artifact@v1
      with:
        name: tools
        path: ./bin/tools
