-
Notifications
You must be signed in to change notification settings - Fork 169
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 #81 from willnorris/actions
migrate CI to GitHub Actions
- Loading branch information
Showing
7 changed files
with
84 additions
and
19 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,18 @@ | ||
on: [push, pull_request] | ||
name: linter | ||
|
||
jobs: | ||
lint: | ||
strategy: | ||
matrix: | ||
go-version: [1.x] | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.41 |
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,46 @@ | ||
on: [push, pull_request] | ||
name: tests | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.x, 1.15.x] | ||
platform: [ubuntu-latest] | ||
include: | ||
# only update test coverage stats with the most recent go version on linux | ||
- go-version: 1.x | ||
platform: ubuntu-latest | ||
update-coverage: true | ||
runs-on: ${{ matrix.platform }} | ||
|
||
permissions: | ||
# styfle/cancel-workflow-action needs to be able to cancel existing action workflows | ||
actions: write | ||
|
||
steps: | ||
- name: Cancel previous | ||
uses: styfle/cancel-workflow-action@89f242ee29e10c53a841bfe71cc0ce7b2f065abc #0.9.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache go modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go- | ||
|
||
- name: Run go test | ||
run: go test -v -race -coverprofile coverage.txt -covermode atomic ./... | ||
|
||
- name: Upload coverage to Codecov | ||
if: ${{ matrix.update-coverage }} | ||
uses: codecov/codecov-action@v2 |
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,12 @@ | ||
linters: | ||
enable: | ||
- dogsled | ||
- dupl | ||
- gofmt | ||
- goimports | ||
- misspell | ||
- nakedret | ||
- stylecheck | ||
- unconvert | ||
- unparam | ||
- whitespace |
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
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