goreleaser github action
This commit is contained in:
parent
f0045be2f8
commit
1cfbd80284
2 changed files with 30 additions and 1 deletions
49
.github/workflows/test.yml
vendored
Normal file
49
.github/workflows/test.yml
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
name: Test
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
|
||||
format:
|
||||
name: Format (gofmt)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: actions/setup-go@main
|
||||
with:
|
||||
go-version: '1.13'
|
||||
- name: Run gofmt
|
||||
run: test -z $(gofmt -l .) || (gofmt -d . && exit 1)
|
||||
|
||||
lint:
|
||||
name: Lint (golangci-lint)
|
||||
runs-on: ubuntu-latest
|
||||
needs: [format]
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: actions/setup-go@main
|
||||
with:
|
||||
go-version: '1.13'
|
||||
- name: Run golangci-lint
|
||||
run: |
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.22.2
|
||||
./bin/golangci-lint run -v ./...
|
||||
|
||||
test:
|
||||
name: Test (go test)
|
||||
runs-on: ubuntu-latest
|
||||
needs: [lint]
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: actions/setup-go@main
|
||||
with:
|
||||
go-version: '1.13'
|
||||
- name: Run go test
|
||||
run: go test -race -coverprofile=coverage.txt ./...
|
||||
- name: Upload coverage to codecov.io
|
||||
if: github.event_name == 'push'
|
||||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
file: ./coverage.txt
|
||||
fail_ci_if_error: true
|
||||
Loading…
Add table
Add a link
Reference in a new issue