Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantv committed Mar 24, 2020
2 parents 95e734c + 55067b9 commit d8bd17f
Show file tree
Hide file tree
Showing 8 changed files with 354 additions and 502 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Go

on:
push:
branches: ['*']
tags: ['v*']
pull_request:
branches: ['*']

jobs:

build:
runs-on: ubuntu-latest
steps:

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x

- name: Checkout code
uses: actions/checkout@v2

- name: Load cached dependencies
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install
run: make install

- name: Test
run: make test_ci

- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v1

release:
runs-on: ubuntu-latest

# Only release pushes of tags starting with v and if the build succeeded.
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [build]

steps:

- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.14.x

- name: Checkout code
uses: actions/checkout@v2

- name: Load cached dependencies
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install
run: make install

- name: Release
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./scripts/release.sh ${{ github.ref }}

33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

31 changes: 9 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,45 +1,32 @@
PACKAGES := $(shell glide novendor | grep -v '/testdata/')

export GO15VENDOREXPERIMENT=1

.DEFAULT_GOAL:=build


.PHONY: build
build:
go build -i $(PACKAGES)
go build -i .
go build ./...

.PHONY: install
install:
glide --version || go get github.com/Masterminds/glide
glide install
go mod download


.PHONY: test
test:
go test -cover -race $(PACKAGES)


.PHONY: install_ci
install_ci: install
go get github.com/wadey/gocovmerge
go get github.com/mattn/goveralls
go get golang.org/x/tools/cmd/cover
go test -cover -race ./...


.PHONY: docs
docs:
go install .
go build
# Automatically update the Usage section of README.md with --help (wrapped to 80 characters).
screen -d -m bash -c 'stty cols 80 && ${GOPATH}/bin/yab --help | python -c "import re; import sys; f = open(\"README.md\"); r = re.compile(r\"\`\`\`\nUsage:.*?\`\`\`\", re.MULTILINE|re.DOTALL); print r.sub(\"\`\`\`\n\" + sys.stdin.read() + \"\`\`\`\", f.read().strip())" | sponge README.md'
screen -d -m bash -c 'stty cols 80 && $(CURDIR)/yab --help | python -c "import re; import sys; f = open(\"README.md\"); r = re.compile(r\"\`\`\`\nUsage:.*?\`\`\`\", re.MULTILINE|re.DOTALL); print r.sub(\"\`\`\`\n\" + sys.stdin.read() + \"\`\`\`\", f.read().strip())" | sponge README.md'
# Update our manpage output and HTML pages.
$$GOPATH/bin/yab --man-page > man/yab.1
$(CURDIR)/yab --man-page > man/yab.1
groff -man -T html man/yab.1 > man/yab.html
[[ -d ../yab_ghpages ]] && cp man/yab.html ../yab_ghpages/man.html
@echo "Please update gh-pages"

.PHONY: test_ci
test_ci: install_ci build
./scripts/cover.sh $(shell go list $(PACKAGES))

test_ci: install build
go test -coverprofile=cover.out -coverpkg=./... ./...
go tool cover -html=cover.out -o cover.html
Loading

0 comments on commit d8bd17f

Please sign in to comment.