github.com/Laisky/zap@v1.27.0/.github/workflows/go.yml (about)

     1  name: Go
     2  
     3  on:
     4    push:
     5      branches: [master]
     6      tags: ['v*']
     7    pull_request:
     8      branches: ['*']
     9  
    10  permissions:
    11    contents: read
    12  
    13  jobs:
    14  
    15    build:
    16      runs-on: ubuntu-latest
    17      strategy:
    18        matrix:
    19          go: ["1.21.x", "1.22.x"]
    20          include:
    21          - go: 1.22.x
    22  
    23      steps:
    24      - name: Checkout code
    25        uses: actions/checkout@v4
    26  
    27      - name: Setup Go
    28        uses: actions/setup-go@v4
    29        with:
    30          go-version: ${{ matrix.go }}
    31          cache-dependency-path: '**/go.sum'
    32  
    33      - name: Download Dependencies
    34        run: |
    35          go mod download
    36          (cd tools && go mod download)
    37          (cd benchmarks && go mod download)
    38          (cd zapgrpc/internal/test && go mod download)
    39  
    40      - name: Test
    41        run: make cover
    42  
    43      - name: Upload coverage to codecov.io
    44        uses: codecov/codecov-action@v4
    45        env:
    46          CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    47  
    48    lint:
    49      name: Lint
    50      runs-on: ubuntu-latest
    51  
    52      steps:
    53      - uses: actions/checkout@v4
    54        name: Check out repository
    55      - uses: actions/setup-go@v4
    56        name: Set up Go
    57        with:
    58          go-version: 1.22.x
    59          cache: false  # managed by golangci-lint
    60  
    61      - uses: golangci/golangci-lint-action@v4
    62        name: Install golangci-lint
    63        with:
    64          version: latest
    65          args: --version  # make lint will run the linter
    66  
    67      - run: make lint
    68        name: Lint
    69  
    70      - name: vulncheck
    71        run: make vulncheck