Skip to content

Commit

Permalink
make it easier to debug test failures, hopefully
Browse files Browse the repository at this point in the history
split .pages.sh error handling out into .post.sh
via state file and put the latter to after the
build result uploaded
  • Loading branch information
mirabilos committed Jan 10, 2025
1 parent d4c4f20 commit 37c4b0b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
{
"uses": "actions/[email protected]"
},
{
"run": "./.post.sh"
},
{
"id": "deployment",
"uses": "actions/[email protected]"
Expand Down Expand Up @@ -57,6 +60,9 @@
},
{
"uses": "actions/[email protected]"
},
{
"run": "./.post.sh"
}
]
}
Expand Down
15 changes: 10 additions & 5 deletions .pages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export LC_ALL=C
unset LANGUAGE

set -o pipefail
rm -f .post.state
if test -h .post.state || test -e .post.state; then exit 255; fi
state=''

$sudoagi eatmydata
sudoapt clean
Expand All @@ -40,12 +43,12 @@ eatmydata env TMPDIR=/tmp npm install

(eatmydata npm run clean || :)
eatmydata npm run build
eatmydata npm run test
eatmydata npm run test-min
eatmydata npm run test || state="$state test"
eatmydata npm run test-min || state="$state test-min"
if [[ $GITHUB_REPOSITORY = danvk/dygraphs ]]; then
eatmydata npm run coverage
eatmydata scripts/post-coverage.sh
eatmydata scripts/weigh-in.sh
eatmydata npm run coverage || state="$state coverage"
eatmydata scripts/post-coverage.sh || state="$state post-coverage"
eatmydata scripts/weigh-in.sh || state="$state weigh-in"
fi

rm -rf _site
Expand All @@ -65,3 +68,5 @@ if [[ -n $imprint_text ]]; then
'
fi
cd ..
set -o noglob
echo $state >.post.state
10 changes: 10 additions & 0 deletions .post.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

echo ::group::Check whether .pages.sh failed anywhere
state=$(cat .post.state || echo state-file-missing)
if test -n "$state"; then
echo "E: .pages.sh failed in: $state"
exit 1
fi
echo "I: nope, ok"
echo ::endgroup::
1 change: 1 addition & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Copyright (c) 2014 mirabilos <[email protected]>
Copyright (c) 2015 Petr Shevtsov <[email protected]>
Copyright (c) 2022, 2023 mirabilos <[email protected]>
Deutsche Telekom LLCTO
Copyright (c) 2025 mirabilos <[email protected]>
and numerous contributors (see git log)

Some tests additionally are:
Expand Down

0 comments on commit 37c4b0b

Please sign in to comment.