Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devops: adds test action; makes run-all-checks exit with proper status code #150

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
25 changes: 25 additions & 0 deletions .github/workflows/script-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Run scripted tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: [3.0.0]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# caches and runs bundle automatically - see
# https://github.com/ruby/setup-ruby#caching-bundle-install-automatically
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: bundle exec jekyll build
- run: cd _bin && ./run-all-checks.sh
50 changes: 41 additions & 9 deletions _bin/run-all-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dir=$(cd "$(dirname "$0")/.." && pwd)
bin="$dir/_bin"
root="$dir/_site"
failed=0
test -d "$root" || {
echo "Please generate the site first."
echo " bundle exec jekyll serve"
Expand All @@ -11,29 +12,60 @@ test -d "$root" || {

echo "[Checking page generation]"
"$bin/check-page-generation.sh"
test $? -eq 0 && echo "--> Page generation looks good."
if [ $? -ne 0 ]; then
failed=$((failed+1))
else
echo "--> Page generation looks good."
fi

echo
echo "[Checking user IDs]"
"$bin/check-user-ids.sh"
test $? -eq 0 && echo "--> User IDs look good."
if [ $? -ne 0 ]; then
failed=$((failed+1))
else
echo "--> User IDs look good."
fi


echo
echo "[Checking include usage]"
"$bin/check-include-usage.sh"
test $? -eq 0 && echo "--> Includes look good."
if [ $? -ne 0 ]; then
failed=$((failed+1))
else
echo "--> Includes look good."
fi


echo
echo "[Checking include documentation]"
"$bin/check-include-help.sh"
test $? -eq 0 && echo "--> Include docs look good."
if [ $? -ne 0 ]; then
failed=$((failed+1))
else
echo "--> Include docs look good."
fi


echo
echo "[Checking HTML element id values]"
"$bin/check-html-ids.sh"
test $? -eq 0 && echo "--> HTML element ids look good."
if [ $? -ne 0 ]; then
failed=$((failed+1))
else
echo "--> HTML element ids look good."
fi

echo
echo "[Checking site HTML]"
"$bin/check-site-html.sh"
test $? -eq 0 && echo "--> Site HTML looks good! Congratulations."

# echo
# echo "[Checking site HTML]"
# "$bin/check-site-html.sh"
# if [ $? -ne 0 ]; then
# failed=$((failed+1))
# else
# echo "--> Site HTML looks good! Congratulations."
# fi

echo "$failed checks failed."
exit $failed