update linter 1.62.2 #75
Workflow file for this run
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
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
name: Lint & Test | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.23.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
check-latest: true | |
cache: true | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Test | |
run: | | |
go test ./... | |
lint: | |
strategy: | |
matrix: | |
go-version: [1.23.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: golangci-lint | |
uses: golangci/[email protected] | |
with: | |
version: v1.62.2 | |
args: -v --config config/.golangci-no-plugin.yml | |
lint-plugin: | |
strategy: | |
matrix: | |
go: [1.23.x] | |
os: [ubuntu-latest] | |
name: lint-plugin | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
check-latest: true | |
cache: true | |
- uses: actions/checkout@v4 | |
name: Checkout code | |
- name: Install golangci-lint | |
run: | | |
go install github.com/golangci/golangci-lint/cmd/[email protected] | |
- name: Build plugin | |
run: | | |
go build --buildmode plugin -o cerrl.so plugin/cerrl.go | |
- name: Run linter | |
run: | | |
golangci-lint run -v --out-format github-actions --config config/.golangci-plugin-only.yml | |
# | |
# an examlpe for a remote repository | |
# | |
# lint-plugin: | |
# strategy: | |
# matrix: | |
# go: [1.23.x] | |
# os: [ubuntu-latest] | |
# name: lint-plugin | |
# runs-on: ${{ matrix.os }} | |
# steps: | |
# - uses: actions/setup-go@v5 | |
# with: | |
# go-version: ${{ matrix.go }} | |
# check-latest: true | |
# cache: true | |
# - uses: actions/checkout@v4 | |
# name: Checkout code | |
# - name: Install golangci-lint | |
# run: | | |
# go install github.com/golangci/golangci-lint/cmd/[email protected] | |
# - name: Build plugin | |
# run: | | |
# curl -L -o go-lint-cerrl.zip https://github.com/edenlabllc/go-lint-cerrl/archive/refs/tags/v0.1.0.zip | |
# unzip go-lint-cerrl.zip | |
# rm go-lint-cerrl.zip | |
# go build --buildmode plugin -o cerrl.so go-lint-cerrl-0.1.0/plugin/cerrl.go | |
# rm -r go-lint-cerrl-0.1.0 | |
# - name: Run linter | |
# run: | | |
# golangci-lint run -v --timeout 10m --out-format github-actions --config config/.golangci-plugin-only.yml |