Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
run: |
xbps-install -Syu || xbps-install -Syu xbps
xbps-install -yu
xbps-install -y mdbook-linkcheck vmdfmt git
xbps-install -y mdbook-linkcheck vmdfmt git findutils
- uses: actions/checkout@v1
- run: ./res/ci/format.sh
9 changes: 5 additions & 4 deletions res/ci/check-summary.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

ERROR=0

cd src/ || exit 2

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

for file in $files
do
if ! grep "$file" ./SUMMARY.md >/dev/null 2>&1 ; then
echo "$file not in SUMMARY"
if ! grep "$file" ./SUMMARY.md >/dev/null ; then
printf "\033[31;1m=> $file not in SUMMARY\033[m\n"
ERROR=1
fi
done

[ -z "$ERROR" ] && exit 0
exit 2
exit $ERROR
9 changes: 4 additions & 5 deletions res/ci/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@

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

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

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

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

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

Expand Down