Skip to content

chore: update of common workflows #16

chore: update of common workflows

chore: update of common workflows #16

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
- name: Build
run: go build -v ./...
- name: Test with coverage
run: go test -v ./... -coverprofile coverage.out
- name: Upload coverage report to SonarCloud
uses: SonarSource/sonarqube-scan-action@v5
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectKey=${{ vars.SONAR_PROJECT_KEY }}
-Dsonar.organization=${{ vars.SONAR_ORGANIZATION }}
-Dsonar.host.url=${{ vars.SONAR_HOST_URL }}
-Dsonar.go.coverage.reportPaths=coverage.out