diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 96379ba..1b82594 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,21 +1,22 @@ name: Go -on: [push] +on: [push, pull_request] jobs: build: - name: Build + name: Test strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] + go-version: [ "1.15", "1.16", "1.17" ] runs-on: ${{ matrix.os }} steps: - - name: Set up Go 1.13 - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go - - - name: Check out code into the Go module directory - uses: actions/checkout@v2 - - - name: Build - run: go build -v cmd/dot/dot.go + - name: setup Go ${{ matrix.go-version }} + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: checkout + uses: actions/checkout@v2 + - name: build dot command + run: go build -v cmd/dot/dot.go + - name: test + if: ${{ matrix.os != 'windows-latest' }} + run: go test -race -v ./...