-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce common GitHub Action build and test
Sync all gonvenience packages to use GitHub Action for build and test..
- Loading branch information
1 parent
47e2d39
commit ba3a213
Showing
2 changed files
with
70 additions
and
24 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,70 @@ | ||
--- | ||
name: Build and Tests | ||
|
||
on: | ||
push: | ||
tags-ignore: | ||
- '**' | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Build and Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.15 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Verify Go Modules Setup | ||
run: | | ||
go mod verify | ||
- name: Build Go Code | ||
run: | | ||
go build ./... | ||
- name: Sanity Check (go vet) | ||
run: | | ||
go vet ./... | ||
- name: Sanity Check (ineffassign) | ||
run: | | ||
go get github.com/gordonklaus/ineffassign | ||
ineffassign ./... | ||
- name: Sanity Check (golint) | ||
run: | | ||
go get golang.org/x/lint/golint | ||
golint ./... | ||
- name: Sanity Check (misspell) | ||
run: | | ||
go get github.com/client9/misspell/cmd/misspell | ||
find . -type f | xargs misspell -source=text -error | ||
- name: Sanity Check (staticcheck) | ||
run: | | ||
go get honnef.co/go/tools/cmd/staticcheck | ||
staticcheck ./... | ||
- name: Run Go Unit Tests | ||
run: | | ||
go get github.com/onsi/ginkgo/ginkgo github.com/onsi/gomega/... | ||
ginkgo -randomizeAllSpecs -randomizeSuites -failOnPending -nodes=1 -compilers=1 -race -trace -cover | ||
- name: Upload Code Coverage Profile | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
files: ./*.coverprofile | ||
flags: unittests | ||
fail_ci_if_error: true | ||
verbose: false |
This file was deleted.
Oops, something went wrong.