Skip to content

Merge pull request #62 from aptlogica/dependabot-pr-merge #50

Merge pull request #62 from aptlogica/dependabot-pr-merge

Merge pull request #62 from aptlogica/dependabot-pr-merge #50

Workflow file for this run

name: Sonar Scan
on:
push:
branches:
- main
- develop
- master
- 'release/**'
pull_request:
permissions:
contents: read
jobs:
sonar:
name: Sonar Scan
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e #v7.0.0
with:
go-version: '1.26.2'
- name: Install dependencies
run: go mod download
- name: Run tests with coverage
run: |
go test -v ./... \
-coverprofile=coverage.out \
-covermode=atomic \
-coverpkg=./...
- name: Show coverage summary
run: |
go tool cover -func=coverage.out
- name: Sonar Scan
uses: SonarSource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f #v8
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
# - name: Sonar Quality Gate
# uses: SonarSource/sonarqube-quality-gate-action@v1.1.0
# timeout-minutes: 10
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}