Adds Github Actions workflow for Building and Testing (#127)

* Added Github Actions workflow for Reviewing, Building and Testing

* Added codecov workflow

* Fix version of Go used for codecov workflow

* Fixed coverage options
This commit is contained in:
James Mills 2020-01-26 00:21:34 +10:00 committed by GitHub
parent e4e52e907b
commit cae49b3319
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 15 deletions

@ -1,14 +0,0 @@
kind: pipeline
name: default
steps:
- name: build
image: golang:latest
commands:
- go test -v -cover -coverprofile=coverage.txt -covermode=atomic -coverpkg=$(shell go list) -race .
- name: coverage
image: plugins/codecov
settings:
token:
from_secret: codecov-token

19
.github/workflows/codecov.yml vendored Normal file

@ -0,0 +1,19 @@
name: Coverage
on: [pull_request]
jobs:
test:
name: Test and Report
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: 1.13.x
- name: Checkout
uses: actions/checkout@v1
- name: Test
run: go test -v -cover -coverprofile=coverage.txt -covermode=atomic -race .
- name: Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

11
.github/workflows/docker.yml vendored Normal file

@ -0,0 +1,11 @@
name: Docker
on: [pull_request]
jobs:
build:
name: Build Image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: docker build -t bitcask .

22
.github/workflows/go.yml vendored Normal file

@ -0,0 +1,22 @@
name: Go
on: [pull_request]
jobs:
test:
name: Build and Test
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
id: go
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: go build -v .
- name: Test
run: go test -v -race .

28
.github/workflows/reviewdog.yml vendored Normal file

@ -0,0 +1,28 @@
name: ReviewDog
on: [pull_request]
jobs:
golangci-lint:
name: runner / golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
misspell:
name: runner / misspell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: reviewdog/action-misspell@v1
with:
github_token: ${{ secrets.GItHUB_TOKEN }}
shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-review

1
go.mod

@ -5,7 +5,6 @@ go 1.13
require (
github.com/gofrs/flock v0.7.1
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/pelletier/go-toml v1.4.0 // indirect
github.com/pkg/errors v0.9.1
github.com/plar/go-adaptive-radix-tree v1.0.1