Skip to content

Commit

Permalink
ci: lock check (#135)
Browse files Browse the repository at this point in the history
Signed-off-by: weizhou.lan@daocloud.io <weizhou.lan@daocloud.io>
  • Loading branch information
weizhoublue authored Aug 7, 2023
1 parent 86077f9 commit 77b1679
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint-golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ jobs:
run: |
result=${{ steps.golangci_lint.outcome }}
[ "${result}"x == "failure"x ] && echo "step golangci_lint failed" && exit 1
result=${{ steps.other.outcome }}
[ "${result}"x == "failure"x ] && echo "step gokart failed" && exit 3
result=${{ steps.lintgolang.outcome }}
[ "${result}"x == "failure"x ] && echo "step lintgolang failed" && exit 3
echo "all succeed"
exit 0
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,18 @@ lint_golang_format:

.PHONY: lint_golang_lock
lint_golang_lock:
@ for l in sync.Mutex sync.RWMutex; do \
@ BAD="" ; \
for l in sync.Mutex sync.RWMutex; do \
DATA=` grep -r --exclude-dir={.git,_build,vendor,externalversions,lock,contrib} -i --include \*.go "$${l}" . ` || true ; \
if [ -n "$${DATA}" ] ; then \
echo "Found $${l} usage. Please use pkg/lock instead to improve deadlock detection"; \
echo "$${DATA}" ; \
exit 1 ;\
BAD="true" ;\
fi ; \
done
done; \
if [ -n "$${BAD}" ] ; then \
exit 1 ; \
fi


# should label for each test file
Expand Down

0 comments on commit 77b1679

Please sign in to comment.