Bump github.com/golangci/golangci-lint from 1.61.0 to 1.63.4 in /tools #411
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: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+* | |
pull_request: | |
permissions: | |
contents: read | |
packages: write | |
checks: write | |
pull-requests: write | |
jobs: | |
test: | |
if: github.event_name == 'pull_request' | |
name: Test | |
timeout-minutes: 15 | |
continue-on-error: false | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go release | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache-dependency-path: "**/go.sum" | |
- name: Download Go modules | |
run: | | |
pushd tools && go mod download -x | |
popd && go mod download -x | |
- name: Install development tools | |
run: make init | |
- name: Build binaries | |
run: make build | |
- name: Run tests | |
run: | | |
go clean -testcache | |
PMM_DUMP_MAX_PARALLEL_TESTS=3 make run-tests | |
# TODO: Add codecoverage | |
# - name: Upload coverage results | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# token: ${{ secrets.CODECOV_TOKEN }} | |
# file: crosscover.out | |
# flags: crosscover | |
# fail_ci_if_error: false | |
- name: Check that there are no source code changes | |
run: | | |
# Break job if any files were changed during its run (code generation, etc), except go.sum. | |
# `go mod tidy` could remove old checksums from that file, and that's okay on CI, | |
# and actually expected for PRs made by @dependabot. | |
# Checksums of actually used modules are checked by previous `go` subcommands. | |
pushd tools && go mod tidy -v && git checkout go.sum | |
popd && go mod tidy -v && git checkout go.sum | |
git diff --exit-code | |
- name: Run debug commands on failure | |
if: ${{ failure() }} | |
run: | | |
env | |
go version | |
go env | |
pwd | |
git status | |
check: | |
name: Check | |
timeout-minutes: 10 | |
if: github.event_name == 'pull_request' | |
continue-on-error: false | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
- name: Set up Go release | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache-dependency-path: "**/go.sum" | |
- name: Download Go modules | |
run: | | |
pushd tools && go mod download -x | |
popd && go mod download -x | |
- name: Install tools | |
run: make init | |
- name: Build binaries | |
run: make build | |
- name: Format sources | |
run: make format | |
- name: Run check-license | |
run: | | |
# run license checker on configured files | |
bin/license-eye -c .licenserc.yaml header check | |
- name: Run checks/linters | |
run: | | |
# use GITHUB_TOKEN because only it has access to GitHub Checks API | |
bin/golangci-lint run --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -reporter=github-pr-review -filter-mode=nofilter -fail-on-error=true | |
# run it like that until some of those issues/PRs are resolved: | |
# * https://github.com/quasilyte/go-consistent/issues/33 | |
# * https://github.com/golangci/golangci-lint/issues/288 | |
# * https://github.com/reviewdog/errorformat/pull/47 (once it is actually used by reviewdog) | |
bin/go-consistent -exclude=tools -pedantic ./... | |
- name: Check that there are no source code changes | |
run: | | |
# Break job if any files were changed during its run (tools installation, etc), except go.sum. | |
# `go mod tidy` could remove old checksums from that file, and that's okay on CI, | |
# and actually expected for PRs made by @dependabot. | |
# Checksums of actually used modules are checked by previous `go` subcommands. | |
pushd tools && go mod tidy -v && git checkout go.sum | |
popd && go mod tidy -v && git checkout go.sum | |
git diff --exit-code | |
- name: Run debug commands on failure | |
if: ${{ failure() }} | |
run: | | |
env | |
go version | |
go env | |
pwd | |
git status | |