From d4c812f214ab30decbfdb95a48bd805c62ea3548 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Sat, 13 Aug 2022 21:02:15 +0100 Subject: [PATCH] Add SonarQube and unit tests (#22) --- .github/workflows/test.yml | 35 +++++++++++++++++++++++++++++++++++ ipilot_test.go | 29 +++++++++++++++++++++++++++++ sonar-project.properties | 6 ++++++ 3 files changed, 70 insertions(+) create mode 100644 .github/workflows/test.yml create mode 100644 ipilot_test.go create mode 100644 sonar-project.properties diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1f5b8e6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +name: Test +on: + pull_request: + push: + branches: [ main ] +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - 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+