-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2687 from kolyshkin/more-github-actions
More GitHub actions
- Loading branch information
Showing
4 changed files
with
93 additions
and
29 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: validate | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
pull_request: | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
# must be specified without patch version | ||
version: v1.31 | ||
|
||
# Only show new issues for a pull request. | ||
only-new-issues: true | ||
|
||
shfmt: | ||
name: shfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: vars | ||
run: | | ||
echo "VERSION=3.2.0" >> $GITHUB_ENV | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: cache go mod and $GOCACHE | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-shfmt-${{ env.VERSION }} | ||
restore-keys: ${{ runner.os }}-shfmt- | ||
- name: install shfmt | ||
run: | | ||
command -v shfmt || \ | ||
(cd ~ && GO111MODULE=on time go get mvdan.cc/sh/v3/cmd/shfmt@v$VERSION) | ||
- name: shfmt | ||
run: make shfmt | ||
|
||
shellcheck: | ||
name: shellcheck | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: vars | ||
run: | | ||
echo 'VERSION=v0.7.1' >> $GITHUB_ENV | ||
echo 'BASEURL=https://github.com/koalaman/shellcheck/releases/download' >> $GITHUB_ENV | ||
echo 'SHA256SUM=1e8499d6f90481bfa2af7a4dce86dd9bcba5c0fbd88bf4793b34ec679c8bb98a' >> $GITHUB_ENV | ||
echo ~/bin >> $GITHUB_PATH | ||
- name: install shellcheck | ||
run: | | ||
mkdir ~/bin | ||
curl -sSfL $BASEURL/$VERSION/shellcheck-$VERSION.linux.x86_64.tar.xz | | ||
tar xfJ - -C ~/bin --strip 1 shellcheck-$VERSION/shellcheck | ||
sha256sum ~/bin/shellcheck | grep -q $SHA256SUM | ||
# make sure to remove the old version | ||
sudo rm -f /usr/bin/shellcheck | ||
- uses: lumaxis/shellcheck-problem-matchers@v1 | ||
- name: shellcheck | ||
run: | | ||
make shellcheck | ||
deps: | ||
name: deps | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: cache go mod and $GOCACHE | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go.sum-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go.sum- | ||
- name: verify deps | ||
run: make verify-dependencies |
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
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