tlog.app/go/errors@v0.9.0/.github/workflows/go.yml (about) 1 # This workflow will build a golang project 2 # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go 3 4 name: Go 5 6 on: 7 push: 8 branches: [ "master" ] 9 pull_request: 10 branches: [ "master" ] 11 12 jobs: 13 test: 14 strategy: 15 matrix: 16 os: ["ubuntu-latest", "macos-latest", "windows-latest"] 17 go-ver: ["1.21", "1.20", "1.19"] 18 include: 19 - os: "ubuntu-latest" 20 go-ver: "1.21" 21 cover: true 22 23 runs-on: ${{ matrix.os }} 24 steps: 25 - uses: actions/checkout@v3 26 27 - name: Set up Go 28 uses: actions/setup-go@v4 29 with: 30 go-version: ${{ matrix.go-ver }} 31 32 - run: pwd 33 34 - name: Build 35 run: go build -v ./... 36 37 - name: Test with Cover 38 run: go test -v -coverprofile=coverage.txt -covermode=atomic ./... 39 if: ${{ matrix.cover }} 40 41 - name: Test without Cover 42 run: go test -v ./... 43 if: ${{ !matrix.cover }} 44 45 - name: Test Race 46 run: go test -race -v ./... 47 48 - name: Upload coverage reports to Codecov 49 uses: codecov/codecov-action@v3 50 if: ${{ matrix.cover }}