File tree Expand file tree Collapse file tree 1 file changed +26
-10
lines changed
Expand file tree Collapse file tree 1 file changed +26
-10
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,31 @@ jobs:
1818 with :
1919 go-version : ' 1.19'
2020
21- - name : Lint multinode
22- working-directory : ./multinode
23- uses : smartcontractkit/.github/actions/ci-lint-go@2ac9d97a83a5edded09af7fcf4ea5bce7a4473a4
24- with :
25- golangci-lint-version : v1.62.2
21+ - name : Find Go modules
22+ id : find-modules
23+ run : |
24+ # Find all directories containing a go.mod file and save them as a newline-separated list
25+ find . -name "go.mod" -exec dirname {} \; > go_modules.txt
26+ echo "modules=$(cat go_modules.txt | tr '\n' ' ')" >> $GITHUB_OUTPUT
2627
27- - name : Lint evm-chain-bindings
28- working-directory : ./tools/evm-chain-bindings
29- uses : smartcontractkit/.github/actions/ci-lint-go@2ac9d97a83a5edded09af7fcf4ea5bce7a4473a4
30- with :
31- golangci-lint-version : v1.62.2
28+ - name : Run golangci-lint for each module
29+ run : |
30+ failed_modules=""
31+ for module in ${{ steps.find-modules.outputs.modules }}; do
32+ echo "Running golangci-lint in $module"
33+ cd $module
34+
35+ if ! golangci-lint run; then
36+ failed_modules="$failed_modules $module"
37+ fi
38+
39+ cd -
40+ done
3241
42+ if [ -n "$failed_modules" ]; then
43+ echo "The following modules failed linting:"
44+ echo "$failed_modules"
45+ exit 1
46+ else
47+ echo "All modules passed linting."
48+ fi
You can’t perform that action at this time.
0 commit comments