Skip to content

Commit

Permalink
ci: fix travis-ci, add code climate
Browse files Browse the repository at this point in the history
Signed-off-by: Nobuhiro MIKI <[email protected]>
  • Loading branch information
bobuhiro11 committed Feb 5, 2021
1 parent f24785a commit cb71b9d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
25 changes: 22 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
dist: focal
sudo: true
addons:
apt:
packages:
- qemu-kvm
- qemu-utils
language: go
go:
- 1.10.x
- 1.11.x
- master
- 1.15.x

before_script:
# See https://github.com/codeclimate/test-reporter/blob/master/examples/go_examples.md
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
script:
# HACK: /dev/kvm is root:kvm 0660 by default
- sudo chmod 666 /dev/kvm
- make gokvm
- make initrd
- make bzImage
- make golangci-lint
- make test
- make clean
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ run:
.PHONY: test
test: golangci-lint initrd bzImage
./golangci-lint run --enable-all --disable gomnd --disable wrapcheck ./...
ls -la /dev/kvm
go test -v ./...
go test -v -coverprofile c.out ./...

.PHONY: clean
clean:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gokvm
# gokvm [![Build Status](https://travis-ci.com/nmi/gokvm.svg?branch=main)](https://travis-ci.com/nmi/gokvm) [![Go Reference](https://pkg.go.dev/badge/github.com/nmi/gokvm.svg)](https://pkg.go.dev/github.com/nmi/gokvm) [![Go Report Card](https://goreportcard.com/badge/github.com/nmi/gokvm)](https://goreportcard.com/report/github.com/nmi/gokvm) [![Maintainability](https://api.codeclimate.com/v1/badges/f60e75353f617035d732/maintainability)](https://codeclimate.com/github/nmi/gokvm/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/f60e75353f617035d732/test_coverage)](https://codeclimate.com/github/nmi/gokvm/test_coverage)

__This is work in progress project__.

Expand Down

0 comments on commit cb71b9d

Please sign in to comment.