Files
katenary/.github/workflows/go-test.yaml
Patrice Ferlet 0d36a48f93 fix(securty): Fix security alert
Code scanning alert: we need to specify permissions on this action.
2025-08-03 23:29:39 +02:00

51 lines
1.2 KiB
YAML

name: Go-Tests
on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- master
- main
push:
branches:
- master
- main
- "releases/**"
jobs:
tests:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.24
- name: Launch Test
run: |
go mod tidy
go vet ./... && go test -coverprofile=coverprofile.out -json -v ./... > gotest.json
- uses: actions/upload-artifact@v4
with:
name: tests-results
path: |
coverprofile.out
gotest.json
sonar:
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: tests-results
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v5.2.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}