CI #21
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
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.19 | |
# https://github.com/stellar/go/blob/master/gomod.sh | |
- name: Run `go mod tidy` | |
run: | | |
go mod tidy | |
git diff --exit-code -- go.mod || (echo '"go.mod" is dirty, update the file with "go mod tidy" locally.' && exit 1) | |
git diff --exit-code -- go.sum || (echo '"go.sum" is dirty, update the file with "go mod tidy" locally.' && exit 1) | |
go mod verify || (echo "One or more Go dependencies failed verification." && exit 1) | |
# https://github.com/golangci/golangci-lint-action | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: latest | |
# https://github.com/stellar/go/blob/master/govet.sh | |
- name: Run `go vet` | |
run: go vet -all -composites=false -unreachable=false -tests=false ./... |