From ae9d05a45ddc5edb9bf8f474904d6670ffa48299 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Fri, 31 Jan 2025 11:55:33 -0400 Subject: [PATCH] Add go.mod checks (#134) Signed-off-by: Yuri Shkuro --- .github/workflows/ci-lint-test.yml | 24 +++++++++++++----------- go.mod | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-lint-test.yml b/.github/workflows/ci-lint-test.yml index 252f303..152b3b4 100644 --- a/.github/workflows/ci-lint-test.yml +++ b/.github/workflows/ci-lint-test.yml @@ -20,33 +20,35 @@ jobs: generated-files-check: runs-on: ubuntu-latest steps: - - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 - with: - egress-policy: audit - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 with: submodules: recursive - name: Verify Protobuf types are up to date run: make proto && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } - - name: Verify Thrift types are up to date + - name: Verify Thrift types are up to date run: make thrift && { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } + go-mod-tidy-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - name: Verify go.mod files are up to date + run: | + go mod tidy && \ + (cd internal/tools && go mod tidy) && \ + { if git status --porcelain | grep '??'; then exit 1; else git diff --name-status --exit-code; fi } + lint: runs-on: ubuntu-latest steps: - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: actions/setup-python@v5 with: python-version: '3.x' - name: Run lint checks run: | make lint - - - - - diff --git a/go.mod b/go.mod index 50ae80d..9760b30 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.22.7 toolchain go1.23.5 require ( + github.com/apache/thrift v0.21.0 github.com/gogo/googleapis v1.4.1 github.com/gogo/protobuf v1.3.2 github.com/stretchr/testify v1.10.0 @@ -14,7 +15,6 @@ require ( ) require ( - github.com/apache/thrift v0.21.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/kr/text v0.2.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect