tjs-w/go-proto-stomp

View on GitHub
.github/workflows/go.yml

Summary

Maintainability
Test Coverage
name: Go

on:
  push:
    branches:
        - main
        - release/*
  pull_request:
    branches: [ main ]

jobs:
  build-test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3

    - name: Set up Go
      uses: actions/setup-go@v3
      with:
        go-version: 1.18

    - name: Go generate
      run: |
        git fetch --unshallow
        go generate ./...

    - name: Run golangci-lint
      uses: golangci/golangci-lint-action@v3.2.0
      with:
        version: latest
        skip-pkg-cache: true
        skip-build-cache: true

    - name: Static code analysis
      uses: dominikh/staticcheck-action@v1.2.0

    - name: Build
      run: go build -v ./...

    - name: Test
      run: |
        go test -v -race -covermode=atomic -coverpkg=github.com/tjs-w/go-proto-stomp/pkg/stomp/... \
        -coverprofile=coverage.out ./...
        go tool cover -func coverage.out -o cover.report
        curl --data-binary @.codecov.yml https://codecov.io/validate

    - name: Codecov
      uses: codecov/codecov-action@v3.1.0

    - name: CodeClimate
      uses: paambaati/codeclimate-action@v3.0.0
      with:
        debug: true
        prefix: github.com/tjs-w/go-proto-stomp
        coverageLocations: ./coverage.out:gocov
      env:
        CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}