From bce90fc2cc0e87a2283cb0eda042bd96fdc09760 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sun, 9 May 2021 15:33:01 -0700 Subject: [PATCH] Add a check for dependencies sync to "Check Go" workflow The dependencies definitions in go.mod and go.sum can become out of sync with the code. This can later result in a bad experience for casual contributors. So it's a good idea to configure the CI to check for this situation automatically. --- .github/workflows/check-go.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/check-go.yml b/.github/workflows/check-go.yml index b62d24d9..d7b8377c 100644 --- a/.github/workflows/check-go.yml +++ b/.github/workflows/check-go.yml @@ -6,11 +6,15 @@ on: paths: - ".github/workflows/check-go.yml" - "Taskfile.yml" + - "go.mod" + - "go.sum" - "**.go" pull_request: paths: - ".github/workflows/check-go.yml" - "Taskfile.yml" + - "go.mod" + - "go.sum" - "**.go" schedule: # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to tools. @@ -69,3 +73,16 @@ jobs: - name: Check formatting run: git diff --color --exit-code + + check-config: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Run go mod tidy + run: go mod tidy + + - name: Check whether any tidying was needed + run: git diff --color --exit-code