github.com/miguelgrubin/gin-boilerplate@v0.0.0-20231208120009-f8f00c6d4138/.github/workflows/go.yml (about)

     1  name: Go
     2  
     3  on:
     4    push:
     5      branches:
     6        - "master"
     7        - "feature/**"
     8        - "hotfix/**"
     9        - "bugfix/**"
    10    pull_request:
    11      branches: ["master"]
    12  
    13  jobs:
    14    build:
    15      runs-on: ubuntu-latest
    16      steps:
    17        - uses: actions/checkout@v4
    18  
    19        - name: Set up Go
    20          uses: actions/setup-go@v4
    21          with:
    22            go-version: "^1.21.2"
    23  
    24        - name: Install revive
    25          run: go install github.com/mgechev/revive@latest
    26  
    27        - name: Lint
    28          run: revive -config revive.toml -exclude vendor/... -formatter friendly ./...
    29  
    30        - name: Build
    31          run: go build -v ./...
    32  
    33        - name: Test
    34          run: go test -v ./... -coverprofile=coverage.out -covermode=atomic
    35  
    36        - name: Upload coverage reports to Codecov
    37          uses: codecov/codecov-action@v3
    38          env:
    39            CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
    40  
    41        - name: Run Gosec Security Scanner
    42          uses: securego/gosec@master
    43          with:
    44            args: ./...