Skip to content

chore(deps): Bump golangci/golangci-lint-action from 8 to 9 #87

chore(deps): Bump golangci/golangci-lint-action from 8 to 9

chore(deps): Bump golangci/golangci-lint-action from 8 to 9 #87

Workflow file for this run

name: Build and publish Go module
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v5
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Cache Go modules & tools
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: |
export PATH=$(go env GOPATH)/bin:$PATH
go install gotest.tools/gotestsum@latest
mkdir -p ./test-reports/
gotestsum --junitfile=./test-reports/junit.xml --format github-actions -- -v -coverprofile=profile.cov -coverpkg=./... ./...
- name: Collect test results
if: always()
uses: actions/upload-artifact@v5
with:
name: test-reports
path: ./test-reports/
- name: Publish test results
uses: mikepenz/action-junit-report@v6
if: always()
with:
report_paths: "./test-reports/junit.xml"
comment: true
include_passed: true
detailed_summary: true
- name: Upload coverage to Coveralls
uses: shogo82148/actions-goveralls@v1
continue-on-error: true
with:
path-to-profile: profile.cov
- name: Lint
uses: golangci/golangci-lint-action@v9
publish-go-module:
runs-on: ubuntu-latest
needs: [build-and-test]
if: github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout code (fetch tags)
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.25"
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# default bump when commits don't indicate a bump type (patch/minor/major).
# keep default_bump=patch to preserve original behaviour; set to "minor"
# if you want a first tag to become v0.1.0 on fresh repositories.
default_bump: patch
# restrict to main branch (optional; defaults to main,master)
release_branches: main
# fetch_all_tags: true # optional if your repo has many tags
# create_annotated_tag: true # optional
- name: Create GitHub Release
if: steps.tag_version.outputs.new_tag != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}