Upgrade golanglint-ci version #8
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
name: Go Lint CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.2' | |
- name: Install dependencies | |
run: | | |
go mod download | |
go mod tidy | |
- name: Install golangci-lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.1 | |
golangci-lint --version | |
- name: Run golangci-lint on PR | |
if: github.event_name == 'pull_request' | |
run: | | |
golangci-lint run --new-from-rev ${{ github.event.pull_request.base.sha }} --config .golangci.yaml | |
continue-on-error: true | |
- name: Run golangci-lint on main branch push | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
golangci-lint run --config .golangci.yaml | |
continue-on-error: true | |
# - name: Display golangci-lint results | |
# if: failure() | |
# run: cat golangci-lint.log |