Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

github: enable github actions #138

Merged
merged 2 commits into from Aug 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,40 @@
on: ["push", "pull_request"]
devimc marked this conversation as resolved.
Show resolved Hide resolved
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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we need it, otherwise goveralls will fail because it's not in the GOPATH (go test .../.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

- 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