github.com/keakon/golog@v0.0.0-20230330091222-cac71197c18d/.github/workflows/go.yml (about)

     1  name: Go
     2  
     3  on:
     4    push:
     5      paths-ignore:
     6        - '*.md'
     7    pull_request:
     8      paths-ignore:
     9        - '*.md'
    10  
    11  jobs:
    12    test:
    13      strategy:
    14        fail-fast: true
    15        matrix:
    16          go: [ '1.19', '1.20' ]
    17          os: [ ubuntu-latest, macos-latest, windows-latest ]
    18      runs-on: ${{ matrix.os }}
    19  
    20      steps:
    21      - name: Checkout code
    22        uses: actions/checkout@v3
    23  
    24      - name: Set up Go
    25        uses: actions/setup-go@v3
    26        with:
    27          go-version: ${{ matrix.go }}
    28  
    29      - name: Race test
    30        run: go test -race
    31  
    32      - name: Test with coverage
    33        if: ${{ matrix.go == '1.20' && matrix.os == 'ubuntu-latest' }}
    34        run: go test -covermode=atomic -coverprofile=coverage -benchmem -bench=. . ./log
    35  
    36      - name: Upload code coverage report
    37        if: ${{ matrix.go == '1.20' && matrix.os == 'ubuntu-latest' }}
    38        uses: codecov/codecov-action@v3
    39        with:
    40          files: coverage
    41          flags: unittests
    42          verbose: true