Use tests.Context(t) instead of context.Background() #886
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
name: Golangci-lint | |
on: [push] | |
jobs: | |
golangci-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21' | |
- 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.55.2 | |
# go.work makes it necessary to run linter manually | |
- name: Run golangci-lint | |
run: find . -name "go.mod" -execdir $(go env GOPATH)/bin/golangci-lint run --enable=gofmt --tests=false --exclude-use-default --timeout=5m0s --out-format checkstyle:golangci-lint-report.xml \; | |
- name: Check golangci-lint report for errors | |
run: find . -name "golangci-lint-report.xml" -exec grep "error" {} + && exit 1 || true | |
- name: Upload golangci-lint report | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: golangci-lint-report | |
path: | | |
./golangci-lint-report.xml |