Skip to content

Go

Go #49

Workflow file for this run

name: Go
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
- name: Test
run: make test
- name: Run tests with coverage
run: |
go test -v -race -covermode atomic -coverprofile=covprofile ./...
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
file: covprofile