From 1af1c0d783d10a16675ad5a1c05acdcb258d51e5 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Mon, 17 Aug 2020 11:39:54 -0500 Subject: [PATCH] github: enable github actions Use github actions to run unit tests. Github actions service looks more stable and reliable than travis. fixes #136 Signed-off-by: Julio Montes --- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..6f55612d3f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +on: ["push", "pull_request"] +name: Unit tests +jobs: + test: + strategy: + matrix: + go-version: [1.13.x, 1.14.x, 1.15.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + env: + GO111MODULE: off + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Setup GOPATH + run: | + gopath_org=$(go env GOPATH)/src/github.com/intel/ + mkdir -p ${gopath_org} + ln -s ${PWD} ${gopath_org} + - name: Checkout code + uses: actions/checkout@v2 + - name: Install gometalinter + run: | + go get github.com/alecthomas/gometalinter + $(go env GOPATH)/bin/gometalinter --install + - name: Running gometalinter + run: | + gopath_repo=$(go env GOPATH)/src/github.com/intel/govmm + pushd ${gopath_repo} + $(go env GOPATH)/bin/gometalinter --tests --vendor --disable-all --enable=misspell --enable=vet --enable=ineffassign --enable=gofmt --enable=gocyclo --cyclo-over=15 --enable=golint --enable=errcheck --enable=deadcode --enable=staticcheck -enable=gas ./... + - name: Send coverage + env: + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gopath_repo=$(go env GOPATH)/src/github.com/intel/govmm + pushd ${gopath_repo} + go get github.com/mattn/goveralls + $(go env GOPATH)/bin/goveralls -v -service=github