Skip to content

Bump github.com/spf13/viper from 1.10.1 to 1.18.2 #338

Bump github.com/spf13/viper from 1.10.1 to 1.18.2

Bump github.com/spf13/viper from 1.10.1 to 1.18.2 #338

Workflow file for this run

---
name: Pull request checks
on: [pull_request]
jobs:
gomod:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: get go version
run: |
gv=$(cat .go-version)
echo "go=$gv" >> $GITHUB_OUTPUT
id: version
- name: install Go
uses: actions/setup-go@v1
with:
go-version: "${{steps.version.outputs.go}}"
- name: check go.mod
# tidy go mod and check for differences
run: "go mod tidy && git diff --exit-code"
gofmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: get go version
run: |
gv=$(cat .go-version)
echo "go=$gv" >> $GITHUB_OUTPUT
id: version
- name: install Go
uses: actions/setup-go@v1
with:
go-version: "${{steps.version.outputs.go}}"
- name: check format
# exit with 0 only if gofmt returns 0 lines
run: "exit $(gofmt | wc -l)"
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: get go version
run: |
gv=$(cat .go-version)
echo "go=$gv" >> $GITHUB_OUTPUT
id: version
- name: install Go
uses: actions/setup-go@v1
with:
go-version: "${{steps.version.outputs.go}}"
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.51.2
# Give the job more time to execute.
# Regarding `--whole-files`, the linter is supposed to support linting of changed a patch only but,
# for some reason, it's very unreliable this way - sometimes it does not report any or some
# issues without linting the whole files, so we have to use `--whole-files`
# which can lead to some frustration from developers who would like to
# fix a single line in an existing codebase and the linter would force them
# into fixing all linting issues in the whole file instead.
args: --timeout=30m --whole-files
license:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: get go version
run: |
gv=$(cat .go-version)
echo "go=$gv" >> $GITHUB_OUTPUT
id: version
- name: install Go
uses: actions/setup-go@v1
with:
go-version: "${{steps.version.outputs.go}}"
- name: check license
# -d returns files without proper header
run: |
GOBIN=$PWD/bin go install github.com/elastic/go-licenser@latest
./bin/go-licenser -license Elasticv2 -d
fragments:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: get go version
run: |
gv=$(cat .go-version)
echo "go=$gv" >> $GITHUB_OUTPUT
id: version
- name: install Go
uses: actions/setup-go@v1
with:
go-version: "${{steps.version.outputs.go}}"
- name: check fragments
run: |
make build
./elastic-agent-changelog-tool pr-has-fragment --repo elastic-agent-changelog-tool ${{github.event.number}}