mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
- Build matrix now includes variants: full + slim - Tag slim images with -slim suffix and use Dockerfile target selection - Use dedicated gha cache scopes per distro+variant - Update release checks/retag/promote scripts to handle slim images too https://chatgpt.com/share/69701a4e-b000-800f-be7e-162dcb93b1d2
40 lines
1.1 KiB
Bash
Executable File
40 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "============================================================"
|
|
echo ">>> Running UNIT tests in ${INFINITO_DISTRO:-<unset>} container (compose stack)"
|
|
echo "============================================================"
|
|
|
|
: "${INFINITO_DISTRO:?INFINITO_DISTRO must be set}"
|
|
: "${TEST_PATTERN:?TEST_PATTERN must be set}"
|
|
: "${TEST_TYPE:?TEST_TYPE must be set}"
|
|
|
|
# Execute directly inside the already running infinito container
|
|
INFINITO_DISTRO="${INFINITO_DISTRO}" \
|
|
docker compose --profile ci exec -T \
|
|
-e TEST_PATTERN="${TEST_PATTERN}" \
|
|
-e TEST_TYPE="${TEST_TYPE}" \
|
|
--workdir /opt/src/infinito \
|
|
infinito \
|
|
bash -lc '
|
|
set -euo pipefail
|
|
|
|
NIX_CONFIG_EFFECTIVE="$(
|
|
printf "%s\n%s\n" \
|
|
"${NIX_CONFIG:-}" \
|
|
"accept-flake-config = true" \
|
|
| sed -e "s/[[:space:]]\+$//" -e "/^$/d"
|
|
)"
|
|
export NIX_CONFIG="${NIX_CONFIG_EFFECTIVE}"
|
|
|
|
echo "PWD=$(pwd)"
|
|
echo "PYTHON=${PYTHON:-<unset>}"
|
|
|
|
if [ -n "${PYTHON:-}" ]; then
|
|
export PATH="$(dirname "$PYTHON"):$PATH"
|
|
fi
|
|
|
|
make setup
|
|
"${PYTHON}" -m unittest discover -s "tests/${TEST_TYPE}" -t . -p "${TEST_PATTERN}"
|
|
'
|