Add SonarQube
This commit is contained in:
32
.github/workflows/test.yml
vendored
Normal file
32
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
name: Test
|
||||
on:
|
||||
pull-request:
|
||||
push:
|
||||
branches: [ main ]
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Create golangci-lint report
|
||||
run: |
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.1
|
||||
cd go
|
||||
/home/runner/go/bin/golangci-lint run --out-format checkstyle -D deadcode,unused --build-tags=integration --timeout 10m --issues-exit-code 0 ./... > ../report.xml
|
||||
cd ..
|
||||
sed -i 's+<file name="+<file name="go/+g' report.xml
|
||||
cat report.xml
|
||||
- uses: sonarsource/sonarqube-scan-action@master
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||
- uses: sonarsource/sonarqube-quality-gate-action@master
|
||||
timeout-minutes: 5
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
6
sonar-project.properties
Normal file
6
sonar-project.properties
Normal file
@@ -0,0 +1,6 @@
|
||||
sonar.projectKey=luketainton_iPilot_AYKYmHI397IDIMpeRtF7
|
||||
sonar.sources=.
|
||||
sonar.exclusions=,.github/**,.gitignore,CODEOWNERS,CHANGELOG.md,LICENSE.md,README.md,renovate.json,**/*_test.go
|
||||
sonar.tests=.
|
||||
sonar.test.inclusions=**/*_test.go
|
||||
sonar.go.golangci-lint.reportPaths=report.xml
|
||||
Reference in New Issue
Block a user