Skip to content

update lint to 1.59.1 #74

update lint to 1.59.1

update lint to 1.59.1 #74

Workflow file for this run

on:
pull_request:
types: [opened, synchronize, reopened]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Lint & Test
jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v3
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.22.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.59.1
args: -v --config config/.golangci-no-plugin.yml
lint-plugin:
strategy:
matrix:
go: [1.22.x]
os: [ubuntu-latest]
name: lint-plugin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v3
name: Checkout code
- name: Install golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
- 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.22.x]
# os: [ubuntu-latest]
# name: lint-plugin
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/setup-go@v3
# with:
# go-version: ${{ matrix.go }}
# - uses: actions/checkout@v3
# name: Checkout code
# - name: Install golangci-lint
# run: |
# go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1
# - 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