Skip to content

Commit

Permalink
#7 - add PR ci validation (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
arkanjoms authored Aug 10, 2023
1 parent cb871d7 commit 9be7477
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Quality
on:
push:
branches:
- master
pull_request:

jobs:
test:
name: quality
runs-on: ubuntu-20.04
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.20'

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: test
run: |
go install github.com/ory/go-acc@latest
go install github.com/golang/mock/[email protected]
go mod download
make test
- name: sonar
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=colibri-project-io
-Dsonar.projectKey=colibri-project-io_colibri-sdk-go
-Dsonar.sources=.
-Dsonar.exclusions=**/*_test.go,**/*.sql,**/*_mock.go
-Dsonar.tests=.
-Dsonar.test.inclusions=**/*_test.go
-Dsonar.go.coverage.reportPaths=/github/workspace/coverage.txt
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
coverage.*

# Jetbrains IDE
.idea/
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@

fmt:
go fmt ./...

mock:
go generate -v ./...

test: mock
go test ./... --coverprofile coverage.out
go-acc ./...

cover:
go tool cover -html coverage.out
go tool cover -html coverage.txt

0 comments on commit 9be7477

Please sign in to comment.