tlog.app/go/tlog@v0.23.1/.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        - name: Build
    33          run: go build -v ./...
    34  
    35        - name: Test with Cover
    36          run: go test -v -coverprofile=coverage.txt -covermode=atomic ./...
    37          if: ${{ matrix.cover }}
    38  
    39        - name: Test without Cover
    40          run: go test -v ./...
    41          if: ${{ !matrix.cover }}
    42  
    43        - name: Test Race
    44          run: go test -race -v ./...
    45  
    46        - name: Upload coverage reports to Codecov
    47          uses: codecov/codecov-action@v3
    48          if: ${{ matrix.cover }}