Add indexer assertions in load tests (#190) #690
This file contains hidden or 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
name: Go Modules Tidy Check | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
mod-tidy-all: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
- name: Read Go version | |
id: tool_versions | |
shell: bash | |
run: | | |
echo "go_version=$(grep -E '^VERSION_GO=' tool-versions.env | cut -d= -f2)" >> $GITHUB_OUTPUT | |
- name: Set up Go | |
uses: actions/setup-go@v6 # v6 | |
with: | |
cache: true | |
go-version: ${{ steps.tool_versions.outputs.go_version }} | |
- name: Populate go envs | |
run: | | |
echo "GOBIN=$(go env GOPATH)/bin" >> $GITHUB_ENV | |
echo "GOCACHE=$(go env GOPATH)/build" >> $GITHUB_ENV | |
- name: Cache Go toolchain artifacts | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ env.GOBIN }} | |
${{ env.GOCACHE }} | |
# hashFiles paths are repo-root relative (not affected by working-directory) | |
key: chainlink-ccv-gotools-${{ runner.os }}-${{ hashFiles('tool-versions.env') }} | |
restore-keys: | | |
chainlink-ccv-gotools-${{ runner.os }}- | |
- name: Install just | |
uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d # v2.0.0 | |
- name: Install go-tools | |
run: just install-go-tools | |
- name: Run repo-wide go mod tidy | |
run: just tidy | |
- name: Verify go.mod and go.sum across all modules | |
run: | | |
files=$(git ls-files | grep -E '(^|/)go\.(mod|sum)$' || true) | |
if [ -z "$files" ]; then | |
echo "No go.mod or go.sum files found." | |
exit 0 | |
fi | |
if ! git diff --exit-code -- $files; then | |
echo "❌ Some go.mod or go.sum files changed after running 'just tidy'." | |
echo "Please run 'just tidy' locally and commit the results." | |
git diff -- $files | cat | |
exit 1 | |
fi |