-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow files and remove travis
Add rebase, release-drafter and tests actions. Add codecov config. Update README.
- Loading branch information
Showing
6 changed files
with
131 additions
and
29 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,20 @@ | ||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
name: Automatic Rebase | ||
jobs: | ||
rebase: | ||
name: Rebase | ||
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the latest code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Automatic Rebase | ||
uses: cirrus-actions/rebase@1.5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,21 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
# branches to consider in the event; optional, defaults to all | ||
branches: | ||
- master | ||
- main | ||
# pull_request event is required only for autolabeler | ||
pull_request: | ||
# Only following types are handled by the action, but one can default to all as well | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,82 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
# Only run if there are changes to Go code or related configurations | ||
paths: | ||
- "**.go" | ||
- "go.mod" | ||
- "go.sum" | ||
- "codecov.yml" | ||
pull_request: | ||
# Only run if there are changes to Go code or related configurations | ||
paths: | ||
- "**.go" | ||
- "go.mod" | ||
- "go.sum" | ||
- "codecov.yml" | ||
|
||
name: Tests | ||
jobs: | ||
test-cache: | ||
name: "Run unit tests" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go-version: [1.16.x, 1.x] | ||
steps: | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
uses: WillAbides/setup-go-faster@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
%LocalAppData%\go-build | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Test with race and coverage | ||
run: | | ||
go test -race -coverprofile=coverage.out -covermode=atomic | ||
go tool cover -func=coverage.out | ||
- uses: codecov/codecov-action@v2 | ||
with: | ||
files: ./coverage.out | ||
|
||
lint: | ||
name: "Run static analysis" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- uses: WillAbides/setup-go-faster@v1 | ||
with: | ||
go-version: "1.x" | ||
|
||
- run: "GO111MODULE=on go get honnef.co/go/tools/cmd/staticcheck" | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/staticcheck | ||
key: staticcheck-${{ github.sha }} | ||
restore-keys: | | ||
staticcheck- | ||
- run: "go vet ./..." | ||
- run: "$(go env GOPATH)/bin/staticcheck ./..." |
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
comment: | ||
layout: "diff, files" | ||
behavior: default | ||
require_changes: false # if true: only post the comment if coverage changes |