|
33 | 33 | sudo rm -rf "$GITHUB_WORKSPACE/.git/index.lock" 2>/dev/null || true |
34 | 34 | sudo rm -rf "$GITHUB_WORKSPACE/.git/shallow.lock" 2>/dev/null || true |
35 | 35 | 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 |
39 | 38 | fi |
40 | 39 | |
41 | 40 | - name: Configure git |
|
51 | 50 | run: | |
52 | 51 | # Use system python3 on self-hosted runner |
53 | 52 | 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 |
55 | 55 | |
56 | 56 | - name: Start test services with Docker |
57 | 57 | run: | |
|
94 | 94 | ipfs-datasets-graphrag-tests:py${{ matrix.python-version }} |
95 | 95 | else |
96 | 96 | 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 |
98 | 103 | python3 -m pytest tests/ -v --tb=short -k "not slow" || echo "Tests completed with errors" |
99 | 104 | fi |
100 | 105 | |
@@ -146,16 +151,17 @@ jobs: |
146 | 151 | - name: Set up Python |
147 | 152 | run: | |
148 | 153 | 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 |
150 | 156 | |
151 | 157 | - name: Run bandit security scan |
152 | 158 | run: | |
153 | | - python3 -m pip install --user bandit |
| 159 | + python3 -m pip install --break-system-packages bandit || python3 -m pip install --user bandit |
154 | 160 | python3 -m bandit -r ipfs_datasets_py/ -f json -o bandit-report.json || true |
155 | 161 | |
156 | 162 | - name: Run dependency vulnerability check |
157 | 163 | run: | |
158 | | - python3 -m pip install --user safety |
| 164 | + python3 -m pip install --break-system-packages safety || python3 -m pip install --user safety |
159 | 165 | python3 -m safety check --json --output safety-report.json || true |
160 | 166 | |
161 | 167 | - name: Upload security scan results |
|
0 commit comments