ci(github): add CI, security (gosec/govulncheck/trivy/codeql), and So… #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sonar | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| sonarcloud: | |
| name: SonarCloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Sonar wants full git history for blame | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23' | |
| cache: true | |
| - name: Tests with coverage | |
| run: go test -race -coverprofile=coverage.out -covermode=atomic ./... | |
| - name: SonarCloud scan | |
| uses: SonarSource/sonarqube-scan-action@v4 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| with: | |
| args: > | |
| -Dsonar.projectKey=RandomCodeSpace_qctx | |
| -Dsonar.organization=randomcodespace | |
| -Dsonar.go.coverage.reportPaths=coverage.out | |
| -Dsonar.sources=. | |
| -Dsonar.exclusions=**/*_test.go,**/test/**,**/vendor/**,**/docs/** | |
| -Dsonar.tests=. | |
| -Dsonar.test.inclusions=**/*_test.go |