Merge pull request #95 from czerwonk/dependabot/go_modules/golang.org… #105
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: Lint | |
on: | |
push: | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
GO_VERSION: "1.21" | |
steps: | |
- name: Set up Go ${{ env.GO_VERSION }} | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache Go modules | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/go/pkg/mod # Module download cache | |
~/.cache/go-build # Build cache (Linux) | |
key: ${{ runner.os }}-${{ env.GO_VERSION }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-${{ env.GO_VERSION }}-go- | |
- name: Check and get dependencies | |
run: | | |
go mod tidy | |
git diff --exit-code go.mod | |
git diff --exit-code go.sum | |
go mod download | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3.3.1 |