ci: group openbsd log sections for easier failure triage

This commit is contained in:
Sylvestre Ledru
2026-04-15 08:08:37 +02:00
parent 79f5e03823
commit 717140a13c
2 changed files with 25 additions and 12 deletions
+24 -12
View File
@@ -85,8 +85,7 @@ jobs:
# * determine sub-crate utility list
UTILITY_LIST="\$(./util/show-utils.sh --features ${{ matrix.job.features }})"
## Info
# environment
echo "## environment"
echo "::group::environment"
echo "CI='${CI}'"
echo "REPO_NAME='${REPO_NAME}'"
echo "TEST_USER='${TEST_USER}'"
@@ -95,24 +94,27 @@ jobs:
echo "FAULT_PREFIX='\${FAULT_PREFIX}'"
echo "UTILITY_LIST='\${UTILITY_LIST}'"
env | sort
# tooling info
echo "## tooling info"
echo "::endgroup::"
echo "::group::tooling info"
cargo -V
rustc -V
echo "::endgroup::"
#
# To ensure that files are cleaned up, we don't want to exit on error
set +e
unset FAULT
## cargo fmt testing
echo "## cargo fmt testing"
echo "::group::cargo fmt"
# * convert any errors/warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message>
S=\$(cargo fmt -- --check) && printf "%s\n" "\$S" || { printf "%s\n" "\$S" ; printf "%s\n" "\$S" | sed -E -n -e "s/^Diff[[:space:]]+in[[:space:]]+\${PWD//\//\\\\/}\/(.*)[[:space:]]+at[[:space:]]+[^0-9]+([0-9]+).*\$/::\${FAULT_TYPE} file=\1,line=\2::\${FAULT_PREFIX}: \\\`cargo fmt\\\`: style violation (file:'\1', line:\2; use \\\`cargo fmt -- \"\1\"\\\`)/p" ; FAULT=true ; }
echo "::endgroup::"
## cargo clippy lint testing
if [ -z "\${FAULT}" ]; then
echo "## cargo clippy lint testing"
echo "::group::cargo clippy"
CLIPPY_ARGS="--features ${{ matrix.job.features }} --fault-type \${FAULT_TYPE}"
if [ -n "\${FAIL_ON_FAULT}" ]; then CLIPPY_ARGS="\${CLIPPY_ARGS} --fail-on-fault"; fi
python3 util/run-clippy.py \${CLIPPY_ARGS} || FAULT=true
echo "::endgroup::"
fi
# Clean to avoid to rsync back the files and free up disk space
cargo clean
@@ -179,18 +181,18 @@ jobs:
mkdir -p ~/.cargo/bin
# Note: nextest might not have OpenBSD builds, so we'll use regular cargo test
## Info
# environment
echo "## environment"
echo "::group::environment"
echo "CI='${CI}'"
echo "REPO_NAME='${REPO_NAME}'"
echo "TEST_USER='${TEST_USER}'"
echo "WORKSPACE_PARENT='${WORKSPACE_PARENT}'"
echo "WORKSPACE='${WORKSPACE}'"
env | sort
# tooling info
echo "## tooling info"
echo "::endgroup::"
echo "::group::tooling info"
cargo -V
rustc -V
echo "::endgroup::"
#
# To ensure that files are cleaned up, we don't want to exit on error
set +e
@@ -203,14 +205,24 @@ jobs:
# Avoid filling disk space
export RUSTFLAGS="-C strip=symbols"
# Use cargo test since nextest might not support OpenBSD
if (test -z "\$FAULT"); then cargo test --features '${{ matrix.job.features }}' || FAULT=1 ; fi
if (test -z "\$FAULT"); then
echo "::group::cargo test (workspace)"
cargo test --features '${{ matrix.job.features }}' || FAULT=1
echo "::endgroup::"
fi
# There is no systemd-logind on OpenBSD, so test all features except feat_systemd_logind
if (test -z "\$FAULT"); then
echo "::group::cargo test (uucore)"
UUCORE_FEATURES=\$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "uucore") | .features | keys | .[]' | grep -v "feat_systemd_logind" | paste -s -d "," -)
cargo test --features "\$UUCORE_FEATURES" -p uucore || FAULT=1
echo "::endgroup::"
fi
# Test building with make
if (test -z "\$FAULT"); then make MULTICALL=Y || FAULT=1 ; fi
if (test -z "\$FAULT"); then
echo "::group::make MULTICALL=Y"
make MULTICALL=Y || FAULT=1
echo "::endgroup::"
fi
# Clean to avoid to rsync back the files and free up disk space
cargo clean
# Additional cleanup to free disk space