Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move golangci-lint from Cloud Build to GitHub Action #3188

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: golangci-lint

on:
push:
pull_request:

permissions:
contents: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: "1.20"
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
version: v1.55.1
args: --timeout=8m
17 changes: 9 additions & 8 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ steps:
name: 'gcr.io/${PROJECT_ID}/trillian_testbase'
entrypoint: ./integration/cloudbuild/prepare.sh

# Run lint and porcelain checks, make sure the diff is empty and no files need
# to be updated. This includes gofmt, golangci-linter, go mod tidy, go mod
# generate and a few more.
- id: lint
# Run porcelain checks, make sure the diff is empty and no files need
# to be updated. This includes gofmt, go mod tidy, go mod generate
# and a few more.
- id: check
name: 'gcr.io/${PROJECT_ID}/trillian_testbase'
entrypoint: ./scripts/presubmit.sh
args:
- --no-build
- --no-linters
- --fix
- --no-mod-tidy
- --empty-diff
Expand All @@ -72,7 +73,7 @@ steps:
- GOFLAGS=-race
- GO_TEST_TIMEOUT=20m
waitFor:
- lint
- check

# Codecov
- id: codecov
Expand All @@ -87,7 +88,7 @@ steps:
- GO_TEST_TIMEOUT=20m
- CODECOV_TOKEN=${_CODECOV_TOKEN}
waitFor:
- lint
- check

# Presubmit (Batched queue)
- id: presubmit_batched
Expand All @@ -100,7 +101,7 @@ steps:
- GOFLAGS=-race --tags=batched_queue
- GO_TEST_TIMEOUT=20m
waitFor:
- lint
- check

# Presubmit (PKCS11)
- id: presubmit_pkcs11
Expand All @@ -113,7 +114,7 @@ steps:
- GOFLAGS=-race --tags=pkcs11
- GO_TEST_TIMEOUT=20m
waitFor:
- lint
- check

# Try to spread the load a bit, we'll wait for all the presubmit.* steps
# to finish before starting the integration.* ones.
Expand Down
Loading