Skip to content

Commit 6a5edae

Browse files
committed
Adds test action; makes run-all-checks exit with proper status code
1 parent e513def commit 6a5edae

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/script-tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Run scripted tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
ruby: [3.0.0]
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
# caches and runs bundle automatically - see
19+
# https://github.com/ruby/setup-ruby#caching-bundle-install-automatically
20+
- uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: ${{ matrix.ruby }}
23+
bundler-cache: true
24+
- run: bundle exec jekyll build
25+
- run: cd _bin && ./run-all-checks.sh

_bin/run-all-checks.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
dir=$(cd "$(dirname "$0")/.." && pwd)
44
bin="$dir/_bin"
55
root="$dir/_site"
6+
any_failed=0
67
test -d "$root" || {
78
echo "Please generate the site first."
89
echo " bundle exec jekyll serve"
@@ -12,28 +13,36 @@ test -d "$root" || {
1213
echo "[Checking page generation]"
1314
"$bin/check-page-generation.sh"
1415
test $? -eq 0 && echo "--> Page generation looks good."
16+
test $? -eq 0 && any_failed=1
1517

1618
echo
1719
echo "[Checking user IDs]"
1820
"$bin/check-user-ids.sh"
1921
test $? -eq 0 && echo "--> User IDs look good."
22+
test $? -eq 0 && any_failed=1
2023

2124
echo
2225
echo "[Checking include usage]"
2326
"$bin/check-include-usage.sh"
2427
test $? -eq 0 && echo "--> Includes look good."
28+
test $? -eq 0 && any_failed=1
2529

2630
echo
2731
echo "[Checking include documentation]"
2832
"$bin/check-include-help.sh"
2933
test $? -eq 0 && echo "--> Include docs look good."
34+
test $? -eq 0 && any_failed=1
3035

3136
echo
3237
echo "[Checking HTML element id values]"
3338
"$bin/check-html-ids.sh"
3439
test $? -eq 0 && echo "--> HTML element ids look good."
40+
test $? -eq 0 && any_failed=1
3541

3642
echo
3743
echo "[Checking site HTML]"
3844
"$bin/check-site-html.sh"
3945
test $? -eq 0 && echo "--> Site HTML looks good! Congratulations."
46+
test $? -eq 0 && any_failed=1
47+
48+
exit $any_failed

0 commit comments

Comments
 (0)