Skip to content

Commit

Permalink
Adding grouping in GitHub Actions output.
Browse files Browse the repository at this point in the history
Signed-off-by: Tim 'mithro' Ansell <[email protected]>
  • Loading branch information
mithro committed Dec 14, 2021
1 parent c7309c6 commit 0a0adde
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
12 changes: 8 additions & 4 deletions .github/scripts/generate-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ PYTHONHASHSEED=0
PRJXRAY_INFO_REVISION=$(grep "prjxray/commit" Info.md | sed -e's-.*/prjxray/commit/--' -e's/\([0-9a-fA-F]*\).*$/\1/')

echo
echo "Project X-Ray Database Revision $(git describe --long --tags --always)"
echo "::group::Project X-Ray Database Revision $(git describe --long --tags --always)"
echo "--------------------------------------------"
git log -1
echo "--------------------------------------------"
echo "::endgroup::"
echo

# Remove any pre-existing html output.
Expand Down Expand Up @@ -55,7 +56,7 @@ fi
# Reset to the right revision
git reset --hard $PRJXRAY_INFO_REVISION
echo
echo "Project X-Ray Revision $(git describe --long --tags --always)"
echo "::group::Project X-Ray Revision $(git describe --long --tags --always)"
echo "--------------------------------------------"
echo "Info says version should be $(git describe --long --tags --always $PRJXRAY_INFO_REVISION) ($PRJXRAY_INFO_REVISION)"
echo "--------------------------------------------"
Expand All @@ -66,6 +67,7 @@ fi
echo
rm -rf database
ln -s $DBDIR database
echo "::endgroup::"
)

# Generate the HTML for each device we have a settings file for.
Expand All @@ -75,7 +77,7 @@ for SETTINGS in $(ls $TMPDIR/prjxray/settings/*.sh | grep '7.sh$'); do
export PYTHONPATH=$PYTHONPATH:$TMPDIR/prjxray

echo
echo "Generating for $DEVICE"
echo "::group::Generating for $DEVICE"
echo "--------------------------------------------"
echo "settings.sh $(sha256sum $SETTINGS)"
cat $SETTINGS
Expand Down Expand Up @@ -103,6 +105,7 @@ for SETTINGS in $(ls $TMPDIR/prjxray/settings/*.sh | grep '7.sh$'); do
echo "--------------------------------------------"
done
fi
echo "::endgroup::"

done

Expand All @@ -119,9 +122,10 @@ python3 -m markdown \
# Output a summary of the generated stuff
(
echo
echo "HTML Results"
echo "::group::HTML Results"
echo "--------------------------------------------"
sha256sum $(find html -type f | sort)
echo "--------------------------------------------"
echo "::endgroup::"
echo
)
14 changes: 10 additions & 4 deletions .github/scripts/push-html.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TMPDIR=$(mktemp -d)

# Clone the destination
echo
echo "Cloning GitHub pages"
echo "::group::Cloning GitHub pages"
echo "--------------------------------------------"
ssh-add -l
ssh -v github.com || true
Expand All @@ -37,9 +37,10 @@ TMPDIR=$(mktemp -d)
find -type f | grep -v .git | sort
)
echo "--------------------------------------------"
echo "::endgroup::"

echo
echo "Updating html"
echo "::group::Updating html"
echo "--------------------------------------------"
rm -rf html/*
cp -a $SRCDIR/html/* html/
Expand All @@ -48,11 +49,12 @@ TMPDIR=$(mktemp -d)
git add --all .
)
echo "--------------------------------------------"
echo "::endgroup::"

(
cd html
echo
echo "Committing"
echo "::group::Committing"
echo "--------------------------------------------"
git status
echo "--------------------------------------------"
Expand All @@ -69,11 +71,15 @@ TMPDIR=$(mktemp -d)
-m "" \
-m "$CURRENT_MESSAGE"
fi
echo "--------------------------------------------"
echo "::endgroup::"

echo
echo "Pushing"
echo "::group::Pushing"
echo "--------------------------------------------"
git push origin
echo "--------------------------------------------"
echo "::endgroup::"
)
)

0 comments on commit 0a0adde

Please sign in to comment.