Skip to content

chore: add mod check #4

chore: add mod check

chore: add mod check #4

Workflow file for this run

# This test ensures that certain Go Modules are not used
# as an import inside of Noble
name: Module Check
on:
pull_request:
env:
# comma separated list of restricted Go modules
RESTRICTED_MODULES: "cosmossdk.io/x/circuit"
jobs:
go-mod-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '>=1.22'
- name: go-mod-why
run: |
for MODULE in "${RESTRICTED_MODULES[@]}"; do
OUTPUT=$(go mod why -m -vendor "$MODULE")
if echo "$OUTPUT" | grep -q "main module does not need to vendor module $MODULE"; then
echo "$MODULE is not imported ✓"
else
echo "$MODULE is currently restricted as an import in Noble ✘"
exit 1
fi
done