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 0168aa7 commit a632e0c
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 42 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/ci-without-go-modules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI 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
- name: Codecov
uses: codecov/codecov-action@v1
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

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 GOPATH=$HOME/go
export GOBIN=$(go env GOPATH)/bin
export PATH=$PATH:$GOPATH
export PATH=$PATH:$GOBIN
make check
- name: Codecov
uses: codecov/codecov-action@v1
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 all 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

0 comments on commit a632e0c

Please sign in to comment.