Skip to content

Commit

Permalink
.github/workflows: reimplement github actions CI
Browse files Browse the repository at this point in the history
* Remove golang 1.13 and 1.14, add golang 1.16
* gometalinter has been deprecated, use golangci-lint instead

Signed-off-by: Julio Montes <julio.montes@intel.com>
  • Loading branch information
Julio Montes committed Jul 21, 2021
1 parent 9d6e797 commit 61b6378
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 31 deletions.
45 changes: 14 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,20 @@ jobs:
test:
strategy:
matrix:
go-version: [1.13.x, 1.14.x, 1.15.x]
go-version: [1.15.x, 1.16.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/kata-containers/
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/kata-containers/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/kata-containers/govmm
pushd ${gopath_repo}
go get github.com/mattn/goveralls
$(go env GOPATH)/bin/goveralls -v -service=github
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: -c .golangci.yml -v
- name: go test
run: go test ./...
35 changes: 35 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0

run:
concurrency: 4
deadline: 600s
skip-dirs:
- vendor
# Ignore auto-generated protobuf code.
skip-files:
- ".*\\.pb\\.go$"

linters:
disable-all: true
enable:
- deadcode
- gocyclo
- gofmt
- gosimple
- govet
- ineffassign
- misspell
- staticcheck
- structcheck
- typecheck
- unconvert
- unused
- varcheck

linters-settings:
gocyclo:
min_complexity: 15
unused:
check-exported: true

0 comments on commit 61b6378

Please sign in to comment.