Skip to content

Commit

Permalink
test: add check relax ordering on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
driftluo committed Aug 30, 2024
1 parent 2fb17ab commit b86e176
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions devtools/ci/check-relaxed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

set -euo pipefail

case "$OSTYPE" in
darwin*)
if ! type gsed &>/dev/null || ! type ggrep &>/dev/null; then
echo "GNU sed and grep not found! You can install via Homebrew" >&2
echo >&2
echo " brew install grep gnu-sed" >&2
exit 1
fi

SED=gsed
GREP=ggrep
;;
*)
SED=sed
GREP=grep
;;
esac

find ./ -not -path '*/target/*' -type f -name "*.rs" | xargs grep -H "Relaxed"

if [ $? -eq 0 ]; then
echo "find use Relaxed on code, please check"
exit 1
fi
1 change: 1 addition & 0 deletions devtools/ci/ci_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ case $GITHUB_WORKFLOW in
make check-dirty-rpc-doc
make check-dirty-hashes-toml
devtools/ci/check-cyclic-dependencies.py
devtools/ci/check-relaxed.sh
;;
ci_aarch64_build*)
echo "ci_aarch64_build"
Expand Down

0 comments on commit b86e176

Please sign in to comment.