diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..bccc212 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,37 @@ +name: Go +on: [push] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.12 + uses: actions/setup-go@v1 + with: + go-version: 1.12 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Get dependencies + run: | + make install + + - name: Vet + run: | + make vet + + - name: Build + run: | + make build + + - name: Test + run: | + make test + + - name: SonarCloud Scan + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/.gitignore b/.gitignore index b65a930..eadf4c6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ coverage.out debug.test vendor/ + +# Sonar +.scannerwork/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index db6890b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go -go: - - 1.x -notifications: - email: true -env: - - GO111MODULE=on -before_install: - - go get golang.org/x/lint/golint -script: - - make all -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/README.md b/README.md index fa10566..ca06d53 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # go-azuredevops [![GoDoc](https://godoc.org/github.com/benmatselby/go-azuredevops/azuredevops?status.svg)](https://godoc.org/github.com/benmatselby/go-azuredevops/azuredevops) -[![Build Status](https://travis-ci.org/benmatselby/go-azuredevops.png?branch=master)](https://travis-ci.org/benmatselby/go-azuredevops) -[![codecov](https://codecov.io/gh/benmatselby/go-azuredevops/branch/master/graph/badge.svg)](https://codecov.io/gh/benmatselby/go-azuredevops) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=go-azuredevops&metric=alert_status)](https://sonarcloud.io/dashboard?id=go-azuredevops) [![Go Report Card](https://goreportcard.com/badge/github.com/benmatselby/go-azuredevops?style=flat-square)](https://goreportcard.com/report/github.com/benmatselby/go-azuredevops) `go-azuredevops` is a Go client library for accessing the [Azure DevOps API](https://docs.microsoft.com/en-gb/rest/api/vsts/). This is very much work in progress, so at the moment supports a small subset of the API. @@ -11,12 +10,12 @@ There is partial implementation for the following services -* Boards -* Builds -* Favourites -* Iterations -* Pull Requests -* Work Items +- Boards +- Builds +- Favourites +- Iterations +- Pull Requests +- Work Items ## Usage diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..b41000c --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,13 @@ +sonar.host.url=https://sonarcloud.io +sonar.organization=benmatselby +sonar.projectKey=go-azuredevops +sonar.projectName=go-azuredevops + +sonar.sources=. +sonar.exclusions=**/*_test.go + +sonar.tests=. +sonar.test.inclusions=**/*_test.go + +sonar.go.tests.reportPaths=coverage.out +sonar.go.coverage.reportPaths=coverage.out