Skip to content

Commit d1488d7

Browse files
Merge pull request #781 from endomorphosis/copilot/fix-ci-cd-workflow-issues
Fix GraphRAG Production CI/CD workflow failures on self-hosted runners
2 parents 36a6ee2 + c5552e8 commit d1488d7

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

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

Lines changed: 14 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+
sudo rm -rf "$GITHUB_WORKSPACE"/* "$GITHUB_WORKSPACE"/.[!.]* 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 to override PEP 668 externally-managed-environment protection
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,12 @@ 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+
# Try to install test dependencies with PEP 668 override, fallback to user install
98+
if ! python3 -m pip install --break-system-packages -e ".[test]" 2>/dev/null; then
99+
if ! python3 -m pip install --user -e ".[test]" 2>/dev/null; then
100+
echo "Warning: Failed to install test dependencies, proceeding anyway"
101+
fi
102+
fi
98103
python3 -m pytest tests/ -v --tb=short -k "not slow" || echo "Tests completed with errors"
99104
fi
100105
@@ -146,16 +151,17 @@ jobs:
146151
- name: Set up Python
147152
run: |
148153
python3 --version
149-
python3 -m pip install --user --upgrade pip
154+
# Python 3.12+ requires --break-system-packages to override PEP 668 externally-managed-environment protection
155+
python3 -m pip install --break-system-packages --upgrade pip || python3 -m pip install --user --upgrade pip
150156
151157
- name: Run bandit security scan
152158
run: |
153-
python3 -m pip install --user bandit
159+
python3 -m pip install --break-system-packages bandit || python3 -m pip install --user bandit
154160
python3 -m bandit -r ipfs_datasets_py/ -f json -o bandit-report.json || true
155161
156162
- name: Run dependency vulnerability check
157163
run: |
158-
python3 -m pip install --user safety
164+
python3 -m pip install --break-system-packages safety || python3 -m pip install --user safety
159165
python3 -m safety check --json --output safety-report.json || true
160166
161167
- name: Upload security scan results

0 commit comments

Comments
 (0)