| on: [push, pull_request] |
| name: Test |
| permissions: |
| contents: read |
| jobs: |
| lint: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Install Go |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 |
| with: |
| go-version: 1.26.x |
| cache: false |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| with: |
| path: './src/github.com/kevinburke/ssh_config' |
| # staticcheck needs this for GOPATH |
| - run: | |
| { |
| echo "GO111MODULE=on" |
| echo "GOPATH=$GITHUB_WORKSPACE" |
| echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" |
| } >> "$GITHUB_ENV" |
| - name: Run tests |
| run: make lint |
| working-directory: './src/github.com/kevinburke/ssh_config' |
| |
| test: |
| strategy: |
| matrix: |
| go-version: [1.17.x, 1.18.x, 1.19.x, 1.20.x, 1.21.x, 1.22.x, 1.23.x, 1.24.x, 1.25.x, 1.26.x] |
| runs-on: ubuntu-latest |
| steps: |
| - name: Install Go |
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6 |
| with: |
| go-version: ${{ matrix.go-version }} |
| cache: false |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| with: |
| path: './src/github.com/kevinburke/ssh_config' |
| - run: | |
| { |
| echo "GO111MODULE=off" |
| echo "GOPATH=$GITHUB_WORKSPACE" |
| echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" |
| } >> "$GITHUB_ENV" |
| - name: Run tests with race detector on |
| run: make race-test |
| working-directory: './src/github.com/kevinburke/ssh_config' |