Skip to content

Commit

Permalink
Merge pull request #2 from go-vela/actions
Browse files Browse the repository at this point in the history
Add a GitHub actions for validate and test
  • Loading branch information
KellyMerrick authored Nov 4, 2019
2 parents 1b58e04 + bb110ca commit 84caf4f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
pull_request:
push:
branches:
- master
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
name: Validate/Test
runs-on: ubuntu-latest
container:
image: golang:latest
steps:
- name: clone
uses: actions/checkout@v1
- name: validate
run: |
# Check that go mod tidy produces a zero diff; clean up any changes afterwards.
go mod tidy && git diff --exit-code; code=$?; git checkout -- .; (exit $code)
# Check that go vet ./... produces a zero diff; clean up any changes afterwards.
go vet ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code)
# Check that go fmt ./... produces a zero diff; clean up any changes afterwards.
go fmt ./... && git diff --exit-code; code=$?; git checkout -- .; (exit $code)
- name: test
run: go test -cover ./...

0 comments on commit 84caf4f

Please sign in to comment.