Update golangci-lint and go versions #135
This file contains 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: SonarCloud project analysis | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
schedule: | |
- cron: "1 1 2 * *" | |
permissions: | |
pull-requests: read # allows SonarCloud to decorate PRs with analysis results | |
jobs: | |
Analysis: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Test Dependencies | |
run: make deps | |
- name: Run golangci-lint | |
run: make lint | |
- name: Run Tests | |
run: make test | |
- name: Analyze project with SonarCloud | |
# You can pin the exact commit or the version. | |
# uses: SonarSource/sonarcloud-github-action@de2e56b42aa84d0b1c5b622644ac17e505c9a049 | |
uses: SonarSource/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
# Additional arguments for the sonarcloud scanner | |
args: | |
-Dsonar.tests=. | |
-Dsonar.projectBaseDir=. | |
-Dsonar.sources=. | |
-Dsonar.projectKey=jimmystewpot_dns-preload | |
-Dsonar.organization=jimmystewpot | |
-Dsonar.go.tests.reportPaths=reports/testreport.json | |
-Dsonar.go.coverage.reportPaths=reports/coverage.txt | |
-Dsonar.go.golint.reportPaths=reports/checkstyle-lint.xml | |
-Dsonar.test.inclusions=**/*_test.go | |
-Dsonar.scm.disabled | |
-Dsonar.sourceEncoding=UTF-8 | |
-Dsonar.verbose=true |