Merge pull request #58 from L11R/dependabot/go_modules/github.com/str… #115
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: Go | |
on: | |
pull_request: | |
push: | |
permissions: | |
contents: write | |
jobs: | |
escobar: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Golang | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.x | |
- name: Setup modules cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- uses: actions/checkout@v2 | |
- name: Download dependencies | |
run: go mod download | |
- name: Lint | |
uses: golangci/golangci-lint-action@v2 | |
with: | |
version: v1.52.2 | |
- name: Build | |
run: go build ./cmd/escobar | |
- name: Test | |
run: go test -gcflags=all=-l -v ./... | |
- name: Test race | |
run: go test -gcflags=all=-l -race -v ./... | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
version: latest | |
args: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |