Skip to content

Commit 4db0a78

Browse files
Fix GraphRAG Production CI/CD workflow failures
- Fix workspace cleanup to not delete the workspace directory itself - Add Python 3.12+ compatibility with --break-system-packages flag - Update all pip installation commands with fallback to --user flag - Fixes issue #772 Co-authored-by: endomorphosis <[email protected]>
1 parent b356bec commit 4db0a78

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/workflows/graphrag-production-ci.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ jobs:
3333
sudo rm -rf "$GITHUB_WORKSPACE/.git/index.lock" 2>/dev/null || true
3434
sudo rm -rf "$GITHUB_WORKSPACE/.git/shallow.lock" 2>/dev/null || true
3535
sudo chown -R $USER:$USER "$GITHUB_WORKSPACE" 2>/dev/null || true
36-
# Clean the entire workspace to avoid conflicts
37-
cd /
38-
sudo rm -rf "$GITHUB_WORKSPACE" || true
36+
# Clean workspace contents but keep the directory itself
37+
find "$GITHUB_WORKSPACE" -mindepth 1 -maxdepth 1 -exec sudo rm -rf {} + 2>/dev/null || true
3938
fi
4039
4140
- name: Configure git
@@ -51,7 +50,8 @@ jobs:
5150
run: |
5251
# Use system python3 on self-hosted runner
5352
python3 --version
54-
python3 -m pip install --user --upgrade pip
53+
# Python 3.12+ requires --break-system-packages for system-wide installation
54+
python3 -m pip install --break-system-packages --upgrade pip || python3 -m pip install --user --upgrade pip
5555
5656
- name: Start test services with Docker
5757
run: |
@@ -94,7 +94,7 @@ jobs:
9494
ipfs-datasets-graphrag-tests:py${{ matrix.python-version }}
9595
else
9696
echo "Running tests with system Python"
97-
python3 -m pip install --user -e ".[test]" || true
97+
python3 -m pip install --break-system-packages -e ".[test]" || python3 -m pip install --user -e ".[test]" || true
9898
python3 -m pytest tests/ -v --tb=short -k "not slow" || echo "Tests completed with errors"
9999
fi
100100
@@ -146,16 +146,17 @@ jobs:
146146
- name: Set up Python
147147
run: |
148148
python3 --version
149-
python3 -m pip install --user --upgrade pip
149+
# Python 3.12+ requires --break-system-packages for system-wide installation
150+
python3 -m pip install --break-system-packages --upgrade pip || python3 -m pip install --user --upgrade pip
150151
151152
- name: Run bandit security scan
152153
run: |
153-
python3 -m pip install --user bandit
154+
python3 -m pip install --break-system-packages bandit || python3 -m pip install --user bandit
154155
python3 -m bandit -r ipfs_datasets_py/ -f json -o bandit-report.json || true
155156
156157
- name: Run dependency vulnerability check
157158
run: |
158-
python3 -m pip install --user safety
159+
python3 -m pip install --break-system-packages safety || python3 -m pip install --user safety
159160
python3 -m safety check --json --output safety-report.json || true
160161
161162
- name: Upload security scan results

0 commit comments

Comments
 (0)