Skip to content

Commit

Permalink
Github workflow: code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
mowshon committed Sep 15, 2023
1 parent 76add75 commit 1c16ab0
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/codequality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tests Coverage

on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.20

- name: Checkout code
uses: actions/checkout@v2

- name: Cache Go Modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Generate Coverage Report
run: go test ./... -coverprofile=coverage.out

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4 changes: 0 additions & 4 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@ sonar.exclusions=**/*_test.go
sonar.tests=.
sonar.test.inclusions=**/*_test.go

sonar.go.gometalinter.reportPaths=gometalinter-report.out
sonar.go.govet.reportPaths=govet-report.out
sonar.go.golint.reportPaths=golint-report.out
sonar.go.tests.reportPaths=report.json
sonar.go.coverage.reportPaths=coverage.out

0 comments on commit 1c16ab0

Please sign in to comment.