Workflow file for this run
This file contains hidden or 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 : [main]
tags :
- ' v*'
pull_request :
branches : [main]
jobs :
test :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v4
- name : Set up Go
uses : actions/setup-go@v5
with :
go-version : ' 1.21'
- name : Download dependencies
run : go mod download
- name : Build
run : go build -v ./...
- name : Test
run : go test -v -race -coverprofile=coverage.out ./...
- name : Upload coverage
uses : codecov/codecov-action@v5
with :
files : ./coverage.out
token : ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error : false
lint :
runs-on : ubuntu-latest
steps :
- uses : actions/checkout@v4
- name : Set up Go
uses : actions/setup-go@v5
with :
go-version : ' 1.21'
- name : golangci-lint
uses : golangci/golangci-lint-action@v4
with :
version : latest
release :
needs : [test, lint]
runs-on : ubuntu-latest
if : startsWith(github.ref, 'refs/tags/v')
permissions :
contents : write
steps :
- uses : actions/checkout@v4
with :
fetch-depth : 0
- name : Set up Go
uses : actions/setup-go@v5
with :
go-version : ' 1.21'
- name : Run GoReleaser
uses : goreleaser/goreleaser-action@v6
with :
distribution : goreleaser
version : ' ~> v2'
args : release --clean
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
# Build binaries on main branch pushes (without releasing)
build :
needs : [test, lint]
runs-on : ubuntu-latest
if : github.event_name == 'push' && github.ref == 'refs/heads/main'
steps :
- uses : actions/checkout@v4
with :
fetch-depth : 0
- name : Set up Go
uses : actions/setup-go@v5
with :
go-version : ' 1.21'
- name : Build snapshot
uses : goreleaser/goreleaser-action@v6
with :
distribution : goreleaser
version : ' ~> v2'
args : build --snapshot --clean
- name : Upload artifacts
uses : actions/upload-artifact@v4
with :
name : binaries
path : dist/
You can’t perform that action at this time.