Skip to content

linktokenBnM

linktokenBnM #3147

Workflow file for this run

name: Lint Go
on:
push:
branches: [develop, main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GOLANGCI_LINT_VERSION: v2.11.4
jobs:
gomods:
name: Go Modules Tidy Check
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Run gomods tidy
run: make gomodtidy
- name: Check if any files have been changed
run: |
if ! git diff --quiet HEAD; then
echo "❌ Some go.mod files are out-of-date, run \`make gomodtidy\` and commit your changes."
echo "❌ Some go.mod files are out-of-date, run \`make gomodtidy\` and commit your changes:" >> $GITHUB_STEP_SUMMARY
git diff --name-only | while read -r n ; do
echo "- $n" >> $GITHUB_STEP_SUMMARY
done
exit 1
fi
lint:
strategy:
fail-fast: false
matrix:
dir:
- .
- integration-tests
- party-ceremony
- party-ceremony/integration-tests
runs-on: ubuntu-latest-8cores-32GB
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: ${{ matrix.dir }}/go.mod
cache-dependency-path: ${{ matrix.dir }}/go.sum
- name: Linting Go
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
only-new-issues: "false"
version: ${{ env.GOLANGCI_LINT_VERSION }}
working-directory: ${{ matrix.dir }}
go-generate:
name: Go generate all
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Run go generate ./...
run: make go-generate
- name: Check if any files have been changed
run: |
if ! git diff --quiet HEAD; then
echo "❌ Some generated files are out-of-date, run \`make go-generate\` and commit your changes."
echo "❌ Some generated files are out-of-date, run \`make go-generate\` and commit your changes:" >> $GITHUB_STEP_SUMMARY
git diff --name-only | while read -r n ; do
echo "- $n" >> $GITHUB_STEP_SUMMARY
done
exit 1
fi