Skip to content

Commit

Permalink
ci: trick github log parser using ::group:: and ::endgroup::
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-shuliu committed Jun 18, 2024
1 parent b00103c commit a0e0284
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,40 +92,44 @@ jobs:
-DUnitTest.FailuresAreFatal=1 -DUnitTest.Manager=%UnitTest.Manager
run: |
# Don't specify the container name because `act` will run multiple jobs in parallel and cause name conflicts
echo "starting sequential tests ..."
packages=${{ matrix.packages }}
IFS=','
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
# The EOF of the following heredocs are intentially unindented
# because <<-EOF doesn't like spaces while yaml only allows spaces
# A potential solution is to use a script file instead of a block
for package in $packages; do
echo "setting up container for package $package"
echo "::group::Set up container for package $package"
CONTAINER=$(docker run -d --rm -v `pwd`:/home/irisowner/zpm/ zpm)
docker exec $CONTAINER /usr/irissys/dev/Cloud/ICM/waitISC.sh
docker exec -i $CONTAINER iris session IRIS <<- EOF
zpm "config set analytics 0":1
zpm "repo -r -name registry -url https://pm.community.intersystems.com/":1
halt
EOF
echo "::endgroup::"
echo "Testing package $package"
echo "::group::Test package $package"
set +e
docker exec -i $CONTAINER iris session IRIS <<- EOF
zpm "install $package":1
zpm "$package test -only ${{ env.test-flags }}":1:1
EOF
if [ $? -ne 0 ]; then
echo -e "\nTest for package $package failed" >&2
echo -e "\n${RED}Test for package $package failed${NC}" >&2
else
echo -e "\nTest for package $package passed"
echo -e "\n${GREEN}Test for package $package passed${NC}"
fi
echo "Cleaning up container for package $package"
echo "::endgroup::"
echo "::group::Clean up container for $package"
# To ensure a clean state after using `act` locally
docker stop -t 5 $CONTAINER
echo "::endgroup::"
done
IFS=' '
echo "ending sequential tests ..."

0 comments on commit a0e0284

Please sign in to comment.