mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 12:14:48 +00:00
.github/workflows: reimplement github actions CI
* 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>
This commit is contained in:
parent
9d6e7970b6
commit
61b6378749
33
.github/workflows/main.yml
vendored
33
.github/workflows/main.yml
vendored
@ -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: golangci-lint
|
||||
uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
version: latest
|
||||
args: -c .golangci.yml -v
|
||||
- name: go test
|
||||
run: go test ./...
|
||||
|
35
.golangci.yml
Normal file
35
.golangci.yml
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user