on: [push, pull_request]
name: Test
jobs:
  test:
    strategy:
      matrix:
        go-version: [1.17.x, 1.18.x]
        platform: [ubuntu-latest]
    runs-on: ${{ matrix.platform }}
    steps:
    - name: Install Go
      uses: WillAbides/setup-go-faster@main
      with:
        go-version: ${{ matrix.go-version }}
    - uses: actions/checkout@v2
      with:
         path: './src/github.com/kevinburke/ssh_config'
    # staticcheck needs this for GOPATH
    - run: |
        echo "GO111MODULE=off" >> $GITHUB_ENV
        echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
        echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" >> $GITHUB_ENV
    - name: Run tests
      run: make lint race-test
      working-directory: './src/github.com/kevinburke/ssh_config'
