Skip to content

Commit

Permalink
chore(ci): move vet to GitHub Action (#6911)
Browse files Browse the repository at this point in the history
* chore(ci): move vet to GitHub Action

* vet on main

* dedupe vet.sh

Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>
  • Loading branch information
noahdietz and gcf-merge-on-green[bot] authored Oct 24, 2022
1 parent 014ed42 commit c2bfae3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 0 additions & 4 deletions internal/kokoro/vet.sh → .github/workflows/vet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ set -e
# Display commands being run
set -x

if [[ $(go version) != *"go1.19"* ]]; then
exit 0
fi

# Fail if a dependency was added without the necessary go.mod/go.sum change
# being part of the commit.
go mod tidy
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/vet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: vet
on:
pull_request:
push:
branches:
- main

jobs:
vet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: '1.19'
- name: Install tools
run: |
go install golang.org/x/lint/golint@latest && \
go install golang.org/x/tools/cmd/goimports@latest && \
go install honnef.co/go/tools/cmd/staticcheck@latest
- name: Execute vet.sh
run: ./.github/workflows/vet.sh
1 change: 0 additions & 1 deletion internal/kokoro/continuous.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ try3() { eval "$*" || eval "$*" || eval "$*"; }

# All packages, including +build tools, are fetched.
try3 go mod download
./internal/kokoro/vet.sh

# runDirectoryTests runs all tests in the current directory.
# If a PATH argument is specified, it runs `go test [PATH]`.
Expand Down
1 change: 0 additions & 1 deletion internal/kokoro/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ try3() { eval "$*" || eval "$*" || eval "$*"; }

# All packages, including +build tools, are fetched.
try3 go mod download
./internal/kokoro/vet.sh

set +e # Run all tests, don't stop after the first failure.
exit_code=0
Expand Down

0 comments on commit c2bfae3

Please sign in to comment.