Files
Jim Myhrberg f24d999dff chore(ci/lint/config): update golangci-lint configuration and workflows
Refactor the golangci-lint configuration to use the latest version and
update GitHub Actions workflows. Key changes include:

- Update golangci-lint to v2.6
- Update GitHub Actions to use latest checkout and setup-go actions
- Update Go versions in test matrix
- Remove deprecated cache steps
- Update Makefile golangci-lint tool version
- Minor documentation formatting improvements
2025-10-30 21:24:28 +00:00

138 lines
4.1 KiB
YAML

---
name: CI
on: [push]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
version: v2.6
tidy:
name: Tidy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- name: Check if mods are tidy
run: make check-tidy
# benchmark:
# name: Benchmarks
# runs-on: ubuntu-latest
# if: github.ref != 'refs/heads/main'
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v2
# with:
# go-version: 1.15
# - uses: actions/cache@v2
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
# - name: Run benchmarks
# run: make bench | tee output.raw
# - name: Fix benchmark names
# run: >-
# perl -pe 's/^(Benchmark.+?)\/(\S+)(-\d+)(\s+)/\1__\2\4/' output.raw |
# tr '-' '_' | tee output.txt
# - name: Announce benchmark result
# uses: rhysd/github-action-benchmark@v1
# with:
# tool: "go"
# output-file-path: output.txt
# fail-on-alert: true
# comment-on-alert: true
# github-token: ${{ secrets.GITHUB_TOKEN }}
# auto-push: false
# cov:
# name: Coverage
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v2
# with:
# go-version: 1.15
# - uses: actions/cache@v2
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
# - name: Publish coverage
# uses: paambaati/codeclimate-action@v2.7.4
# env:
# VERBOSE: "true"
# GOMAXPROCS: 4
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
# with:
# coverageCommand: make cov
# prefix: github.com/${{ github.repository }}
# coverageLocations: |
# ${{ github.workspace }}/coverage.out:gocov
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go_version:
- "1.15"
- "1.16"
- "1.18"
- "1.20"
- "1.25"
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
with:
go-version-file: go.mod
- name: Run tests
run: make test
env:
VERBOSE: "true"
# benchmark-store:
# name: Store benchmarks
# runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main'
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-go@v2
# with:
# go-version: 1.15
# - uses: actions/cache@v2
# with:
# path: ~/go/pkg/mod
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# restore-keys: |
# ${{ runner.os }}-go-
# - name: Run benchmarks
# run: make bench | tee output.raw
# - name: Fix benchmark names
# run: >-
# perl -pe 's/^(Benchmark.+?)\/(\S+)(-\d+)(\s+)/\1__\2\4/' output.raw |
# tr '-' '_' | tee output.txt
# - name: Store benchmark result
# uses: rhysd/github-action-benchmark@v1
# with:
# tool: "go"
# output-file-path: output.txt
# github-token: ${{ secrets.ROMDOBOT_TOKEN }}
# comment-on-alert: true
# auto-push: true