Skip to content

Commit 71abbd4

Browse files
committed
ci: fix summary check, make prints consistent
without findutils, the summary check fails: `res/ci/check-summary.sh: 8: find: not found`
1 parent 1e18375 commit 71abbd4

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
run: |
1313
xbps-install -Syu || xbps-install -Syu xbps
1414
xbps-install -yu
15-
xbps-install -y mdbook-linkcheck vmdfmt git
15+
xbps-install -y mdbook-linkcheck vmdfmt git findutils
1616
- uses: actions/checkout@v1
1717
- run: ./res/ci/format.sh

res/ci/check-summary.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
ERROR=0
4+
35
cd src/ || exit 2
46

57
# summary is the list of files taken from SUMMARY.md - unused for now
@@ -9,11 +11,10 @@ files="$( find . -type f -name '*.md' -not -name "SUMMARY.md" )"
911

1012
for file in $files
1113
do
12-
if ! grep "$file" ./SUMMARY.md >/dev/null 2>&1 ; then
13-
echo "$file not in SUMMARY"
14+
if ! grep "$file" ./SUMMARY.md >/dev/null ; then
15+
printf "\033[31;1m=> $file not in SUMMARY\033[m\n"
1416
ERROR=1
1517
fi
1618
done
1719

18-
[ -z "$ERROR" ] && exit 0
19-
exit 2
20+
exit $ERROR

res/ci/format.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,24 @@
22

33
git config --global --add safe.directory "$PWD"
44

5-
echo "Checking links"
5+
printf "\033[37;1m=> Checking links\033[m\n"
66
RUST_LOG=linkcheck=debug mdbook-linkcheck -s
77
LINKCHECK=$?
88

99
# Format them
10-
printf "Formatting tree"
10+
printf "\n\033[37;1m=> Formatting tree\033[m\n"
1111
vmdfmt -l -w src/
1212

1313
# Check Status
1414
if [ ! -z "$(git status --porcelain)" ] ; then
1515
git diff
16-
echo "Working directory not clean, files to be formatted:"
16+
printf "\033[31;1m=> Working directory not clean, files to be formatted:\033[m\n"
1717
git status
1818
VMDFMT=1
1919
fi
2020

2121
# Check SUMMARY.md
22-
echo ""
23-
echo "Checking SUMMARY.md"
22+
printf "\n\033[37;1m=> Checking SUMMARY.md\033[m\n"
2423
res/ci/check-summary.sh
2524
SUMMARY=$?
2625

0 commit comments

Comments
 (0)