-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update CI and add badges to README (#21)
* Update CI and add badges to README CI updates: - Update Go versions (1.17.x and 1.18.x) - Update actions versions - Use actions for staticcheck - Drop golint (deprecated) - Report test coverage * Update README.md Co-authored-by: Peter Bourgon <peterbourgon@users.noreply.github.com> * Update README.md Co-authored-by: Peter Bourgon <peterbourgon@users.noreply.github.com> * Add staticcheck configuration file * Add package doc comment to syslog package Co-authored-by: Peter Bourgon <peterbourgon@users.noreply.github.com>
- Loading branch information
1 parent
2b8dc2b
commit 3752ef7
Showing
4 changed files
with
35 additions
and
17 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 |
---|---|---|
@@ -1,38 +1,49 @@ | ||
on: push | ||
on: | ||
push: | ||
pull_request: | ||
types: [synchronize] | ||
name: Test | ||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go-version: [1.16.x, 1.17.x] | ||
go-version: [1.17.x, 1.18.x] | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Install staticcheck | ||
run: go install honnef.co/go/tools/cmd/staticcheck@latest | ||
shell: bash | ||
- name: Install golint | ||
run: go install golang.org/x/lint/golint@latest | ||
shell: bash | ||
- name: Update PATH | ||
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
shell: bash | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
- name: Fmt | ||
if: matrix.platform != 'windows-latest' # :( | ||
run: "diff <(gofmt -d .) <(printf '')" | ||
shell: bash | ||
- name: Vet | ||
run: go vet ./... | ||
- name: Staticcheck | ||
run: staticcheck ./... | ||
- name: Lint | ||
run: golint ./... | ||
uses: dominikh/staticcheck-action@v1 | ||
with: | ||
install-go: false | ||
cache-key: ${{ matrix.go-version }} | ||
- name: Test | ||
run: go test -race ./... | ||
- name: Test coverage | ||
run: go test -coverprofile="cover.out" ./... # quotes needed for powershell | ||
- name: Send coverage | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: cover.out | ||
flag-name: go${{ matrix.go-version }}-${{ matrix.os }} | ||
parallel: true | ||
# notifies that all test jobs are finished. | ||
finish: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
parallel-finished: true |
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
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 @@ | ||
checks = ["all"] |
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