Skip to content

Commit

Permalink
ci: upgrade to 1.16
Browse files Browse the repository at this point in the history
- updates release to go 1.16
- adds coverage output for sonarcloud

Signed-off-by: Felipe Zipitria <[email protected]>
  • Loading branch information
fzipi committed Aug 28, 2021
1 parent b6ecbe6 commit 0d17a47
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@ name: Test
on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: n8maninger/action-golang-test@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Run Go Tests
uses: n8maninger/action-golang-test@v1
with:
args: '-coverprofile=coverage.out'

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
12 changes: 12 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
sonar.projectKey=fzipi_go-ftw
sonar.organization=fzipi

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=go-ftw
#sonar.projectVersion=1.0

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=.
sonar.exclusions=**/*_test.go
sonar.go.coverage.reportPaths=coverage.out
sonar.test.inclusions=**/*_test.go

0 comments on commit 0d17a47

Please sign in to comment.