github.com/go-playground/webhooks/v6@v6.3.0/.github/workflows/workflow.yml (about)

     1  on:
     2    push:
     3      branches:
     4        - master
     5    pull_request:
     6  
     7  name: Test
     8  jobs:
     9    golangci:
    10      name: lint
    11      runs-on: ubuntu-latest
    12      steps:
    13        - uses: actions/setup-go@v3
    14          with:
    15            go-version: 1.20.x
    16        - uses: actions/checkout@v3
    17        - name: golangci-lint
    18          uses: golangci/golangci-lint-action@v3
    19          with:
    20            version: latest
    21  
    22    test:
    23      name: Test
    24      strategy:
    25        matrix:
    26          go-version: [1.17.x, 1.18.x, 1.20.x]
    27          os: [ubuntu-latest, macos-latest]
    28      runs-on: ${{ matrix.os }}
    29      steps:
    30        - name: Install Go
    31          uses: actions/setup-go@v3
    32          with:
    33            go-version: ${{ matrix.go-version }}
    34  
    35        - name: Checkout code
    36          uses: actions/checkout@v3
    37  
    38        - name: Restore cache
    39          uses: actions/cache@v3
    40          with:
    41            path: ~/go/pkg/mod
    42            key: ${{ runner.os }}-v1-go-${{ hashFiles('**/go.sum') }}
    43            restore-keys: |
    44              ${{ runner.os }}-v1-go-
    45  
    46        - name: Run tests
    47          run: go test -race -covermode=atomic -coverprofile="coverage.out" ./...
    48  
    49        - name: Upload coverage report to Coveralls
    50          if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.18.x'
    51          uses: shogo82148/actions-goveralls@v1
    52          with:
    53            path-to-profile: coverage.out