-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from go-vela/actions
Add a GitHub actions for validate and test
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ./... |