Skip to content

Commit

Permalink
build: display summary in combine script
Browse files Browse the repository at this point in the history
KonradHoeffner committed Mar 21, 2024

Verified

This commit was signed with the committer’s verified signature.
KonradHoeffner Konrad Höffner
1 parent 1f6fa12 commit 4fbe0ec
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions scripts/combine
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
#/bin/sh
# Combine all of SNIK into one file.
# "source scripts/combine" in CI so GITHUB_STEP_SUMMARY gets exported

MYPATH=`dirname "$0"`
MYPATH=`( cd "$MYPATH" && pwd )`
mkdir -p $MYPATH/../dist
cat $MYPATH/../*.ttl $MYPATH/../*.nt | rapper -i turtle -o turtle - http://www.snik.eu/ontology/ > $MYPATH/../dist/snik.ttl
DISTPATH=$MYPATH/../dist
mkdir -p $DISTPATH
cat $MYPATH/../*.ttl $MYPATH/../*.nt | rapper -i turtle -o turtle - http://www.snik.eu/ontology/ > $DISTPATH/snik.ttl
cd $DISTPATH
GITHUB_STEP_SUMMARY="`wc -l snik.nt | cut -f1 -d ' '` triples \n\n"
if type awk > /dev/null 2>&1; then
GITHUB_STEP_SUMMARY+="| Filename | bytes | KiB | MiB | KB | MB |\n"
GITHUB_STEP_SUMMARY+="| -------- | ----- | --- | --- | -- | -- |\n"
# "command ls" in case it is aliased to eza or something else, we need the exact ls output format
GITHUB_STEP_SUMMARY+=`LC_ALL=C command ls -l snik.* | awk '{printf("|%10s |%10s |%9s |%9s |%9s |%9s |\n", $9, $5, $5/1024, $5/1024^2, $5/1000, $5/1000^2)}'`
fi

printf "$GITHUB_STEP_SUMMARY"
export GITHUB_STEP_SUMMARY
cd ..

0 comments on commit 4fbe0ec

Please sign in to comment.