Skip to content

chore(actions)(deps): bump the actions group across 1 directory with 9 updates #7

chore(actions)(deps): bump the actions group across 1 directory with 9 updates

chore(actions)(deps): bump the actions group across 1 directory with 9 updates #7

Workflow file for this run

name: SonarCloud
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: read
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
with:
go-version: '1.26.2'
cache: true
- name: Cache SonarQube packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Test with coverage
run: go test ./... -coverprofile=coverage.out -covermode=atomic
- name: Skip when SONAR_TOKEN is not configured
if: ${{ env.SONAR_TOKEN == '' }}
run: echo "SONAR_TOKEN is not configured; skipping SonarCloud analysis."
- name: SonarCloud scan
if: ${{ env.SONAR_TOKEN != '' }}
uses: SonarSource/sonarqube-scan-action@713881670b6b3676cda39549040e2d88c70d582e # v8.2.0
env:
SONAR_TOKEN: ${{ env.SONAR_TOKEN }}