Skip to content

Commit

Permalink
Configure new ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xorcare committed Nov 22, 2020
1 parent 2769a6d commit 417a719
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 42 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci-without-go-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Continuous Integration Without Go Modules

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Build
strategy:
matrix:
go:
- '1.12'
- '1.11'
- '1.10'
- '1.9'
- '1.8'
os:
- 'ubuntu-18.04'
- 'macos-10.15'
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Running static checks
run: |
export GOPATH=$HOME/go
export GOBIN=$(go env GOPATH)/bin
export PATH=$PATH:$GOPATH
export PATH=$PATH:$GOBIN
mkdir -p $GOPATH/pkg
mkdir -p $GOBIN
mkdir -p $GOPATH/src/github.com/$GITHUB_REPOSITORY
mv $(pwd)/* $GOPATH/src/github.com/$GITHUB_REPOSITORY
cd $GOPATH/src/github.com/$GITHUB_REPOSITORY
go test ./... -count=10 -race
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Continuous Integration

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
name: Build
strategy:
matrix:
go:
- '1.15'
- '1.14'
- '1.13'
os:
- 'ubuntu-18.04'
- 'macos-10.15'
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Installing tools
run: make tools

- name: Running static checks
run: |
export PATH=$PATH:$GOPATH/bin
make check
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

18 changes: 1 addition & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ build: ## Build the project binary
@go build ./...

.PHONY: ci
ci: check checkstate ## Target for integration with ci pipeline
ci: check ## Target for integration with ci pipeline

.PHONY: check
check: static test build ## Check project with static checks and unit tests
Expand Down Expand Up @@ -93,19 +93,3 @@ toolsup: ## Update amakll needed tools, e.g. for static checks
.PHONY: vet
vet: ## Check the project with vet
@go vet ./...

.PHONY: checkstate
checkstate: tools ## Checking the relevance of dependencies, and tools. Also, the absence of arbitrary changes when performing checks.
@echo 'checking the relevance of the dependency list'
@go mod tidy
@git diff --exit-code go.mod go.sum
@echo 'checking the relevance of the committed dependencies'
@go mod vendor
@git diff --exit-code vendor
@echo 'checking the relevance of the committed generated files'
@go generate
@exit $$(git status -s | wc -l)
@echo 'checking the relevance of the committed golden files'
@make testup
@exit $$(git status -s | wc -l)
@go mod verify
1 change: 1 addition & 0 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module tools
go 1.12

require (
github.com/vburenin/ifacemaker v1.1.0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b
golang.org/x/tools v0.0.0-20201117225735-f544f6cb68d6
)
8 changes: 8 additions & 0 deletions internal/tools/go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/jessevdk/go-flags v1.4.1-0.20181029123624-5de817a9aa20 h1:dAOsPLhnBzIyxu0VvmnKjlNcIlgMK+erD6VRHDtweMI=
github.com/jessevdk/go-flags v1.4.1-0.20181029123624-5de817a9aa20/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/vburenin/ifacemaker v1.1.0 h1:3ScCGZ+D65Ud9L0x9ofhN0dk5QrfauzMWYfaYsfA+HE=
github.com/vburenin/ifacemaker v1.1.0/go.mod h1:SlS6qpTccQsoK3ln7mBkUxA4agA8wfPr/IFYqBWerPw=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand All @@ -18,6 +25,7 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181201035826-d0ca3933b724/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7 h1:EBZoQjiKKPaLbPrbpssUfuHtwM6KV/vb4U85g/cigFY=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
Expand Down

0 comments on commit 417a719

Please sign in to comment.