Skip to content

Commit 1750f87

Browse files
committed
Fix CI: skip venv activation in GitHub Actions
1 parent 748f7f0 commit 1750f87

1 file changed

Lines changed: 14 additions & 9 deletions

File tree

  • projects/01_api_health_check/bash

projects/01_api_health_check/bash/run.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,21 @@ TIMEOUT="${2:-10}"
1717
TS="$(date +"%Y%m%d_%H%M%S")"
1818
OUT_FILE="${OUTPUT_DIR}/healthcheck_${TS}.json"
1919

20-
# Activate virtual environment (cross-platform)
21-
if [ -f "${REPO_ROOT}/.venv/Scripts/activate" ]; then
22-
# Windows (Git Bash)
23-
source "${REPO_ROOT}/.venv/Scripts/activate"
24-
elif [ -f "${REPO_ROOT}/.venv/bin/activate" ]; then
25-
# Linux/macOS
26-
source "${REPO_ROOT}/.venv/bin/activate"
20+
# Activate virtual environment (skip in CI)
21+
# GitHub Actions sets CI=true and doesn't need venv
22+
if [ "${CI:-false}" != "true" ]; then
23+
if [ -f "${REPO_ROOT}/.venv/Scripts/activate" ]; then
24+
# Windows (Git Bash)
25+
source "${REPO_ROOT}/.venv/Scripts/activate"
26+
elif [ -f "${REPO_ROOT}/.venv/bin/activate" ]; then
27+
# Linux/macOS
28+
source "${REPO_ROOT}/.venv/bin/activate"
29+
else
30+
echo "Warning: Virtual environment not found at ${REPO_ROOT}/.venv"
31+
echo "Continuing with system Python..."
32+
fi
2733
else
28-
echo "Error: Virtual environment not found at ${REPO_ROOT}/.venv"
29-
exit 1
34+
echo "Running in CI environment, using system Python"
3035
fi
3136

3237
# Run health check

0 commit comments

Comments
 (0)