Add test cases

This commit is contained in:
2022-08-13 20:54:38 +01:00
parent e1997cbca1
commit aa3c0c74f3
2 changed files with 37 additions and 3 deletions

View File

@@ -7,19 +7,24 @@ permissions:
contents: read
jobs:
lint:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- 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
$(go env GOPATH)/bin/golangci-lint run --out-format checkstyle -D deadcode,unused --build-tags=integration --timeout 10m --issues-exit-code 0 ./... > report.xml
sed -i 's+<file name="+<file name="go/+g' report.xml
cat report.xml
- name: Test
run: go test -short -coverprofile=coverage.out
- uses: sonarsource/sonarqube-scan-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}