1- name : NumPy + SciPy C- Extension Switching
1+ name : NumPy + SciPy C Extension Test
22
33on :
44 push :
@@ -30,11 +30,10 @@ jobs:
3030 with :
3131 python-version : ' 3.11'
3232
33- - name : Install dependencies
33+ - name : 📦 Install omnipkg (editable) and Redis client
3434 run : |
3535 python -m pip install --upgrade pip
36- pip install -e . redis numpy==1.26.4 scipy==1.13.0
37-
36+ pip install -e . redis
3837 - name : Configure omnipkg for non-interactive use
3938 run : |
4039 python - << 'EOF'
@@ -44,19 +43,16 @@ jobs:
4443 from pathlib import Path
4544 import os
4645 import sysconfig
47-
4846 try:
4947 site_packages_path = site.getsitepackages()[0]
5048 except (IndexError, AttributeError):
5149 site_packages_path = sysconfig.get_paths()['purelib']
52-
5350 project_root = Path(os.environ['GITHUB_WORKSPACE'])
5451
5552 builder_script = project_root / 'omnipkg' / 'package_meta_builder.py'
5653 if not builder_script.exists():
5754 print(f"Error: {builder_script} does not exist")
5855 sys.exit(1)
59-
6056 config_data = {
6157 'site_packages_path': site_packages_path,
6258 'multiversion_base': str(Path(site_packages_path) / '.omnipkg_versions'),
6965 'auto_cleanup': True,
7066 'cleanup_threshold_days': 30
7167 }
72-
7368 config_dir = Path.home() / '.config' / 'omnipkg'
7469 config_dir.mkdir(parents=True, exist_ok=True)
7570 config_path = config_dir / 'config.json'
@@ -83,59 +78,40 @@ jobs:
8378 print(f"Error writing config: {e}")
8479 sys.exit(1)
8580 EOF
86-
8781 - name : Run the Demo - NumPy + SciPy
8882 id : run_demo
8983 run : |
90- echo "--- Running Omnipkg Demo for NumPy + SciPy (C- Extension Nuclear Testing) ---"
84+ echo "--- Running Omnipkg Demo for NumPy + SciPy (C Extension Nuclear Testing) ---"
9185 mkdir -p /tmp/omnipkg-artifacts
9286
93- # Clear output and run count files
94- rm -f /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt /tmp/omnipkg-artifacts/run_count.txt
95- echo "Starting demo run" > /tmp/omnipkg-artifacts/run_count.txt
96-
97- # Run demo once
98- timeout 900 bash -c 'echo "6" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt'
87+ timeout 900 bash -c 'echo "3" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt'
9988 DEMO_EXIT_CODE=$?
10089
101- # Check run count
102- RUN_COUNT=$(wc -l < /tmp/omnipkg-artifacts/run_count.txt)
103- echo "DEBUG: Demo run count: $RUN_COUNT"
104- if [ "$RUN_COUNT" -ne 1 ]; then
105- echo "Error: Demo ran $RUN_COUNT times instead of once."
106- cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt
107- exit 1
108- fi
109-
11090 echo "## NumPy + SciPy Demo Output" >> $GITHUB_STEP_SUMMARY
11191 echo '```' >> $GITHUB_STEP_SUMMARY
11292 cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt >> $GITHUB_STEP_SUMMARY
11393 echo '```' >> $GITHUB_STEP_SUMMARY
11494
115- # Fix PASSED_COUNT to handle empty output
116- PASSED_COUNT=$(grep -c "PASSED" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt 2>/dev/null || echo "0")
117- echo "DEBUG: PASSED_COUNT: $PASSED_COUNT"
118-
11995 if [ $DEMO_EXIT_CODE -eq 0 ] || \
120- (grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
121- grep -q "OMNIPKG SURVIVED NUCLEAR TESTING" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
122- grep -q "Demo completed successfully" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt); then
123- echo "Demo completed successfully (exit code $DEMO_EXIT_CODE, logs verified)."
124- echo "demo_outcome=success" >> $GITHUB_OUTPUT
125- if [ "$PASSED_COUNT" -ge 6 ]; then
126- echo "NumPy + SciPy demo verified: Found $PASSED_COUNT PASSED results (expected at least 6)!"
127- else
128- echo "Error: Expected at least 6 PASSED results, but found only $PASSED_COUNT."
129- cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt
130- exit 1
131- fi
96+ (grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
97+ grep -q "OMNIPKG SURVIVED NUCLEAR TESTING" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
98+ grep -q "Demo completed successfully" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt); then
99+ echo "Demo completed successfully (exit code $DEMO_EXIT_CODE, logs verified)."
100+ echo "demo_outcome=success" >> $GITHUB_OUTPUT
101+ PASSED_COUNT=$(grep -c "PASSED" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt || echo "0")
102+ if [ "$PASSED_COUNT" -ge 12 ]; then
103+ echo "NumPy + SciPy demo verified: Found $PASSED_COUNT PASSED results (expected at least 12)!"
104+ else
105+ echo "Error: Expected at least 12 PASSED results, but found only $PASSED_COUNT."
106+ cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt
107+ exit 1
108+ fi
132109 else
133110 echo "Demo failed with exit code $DEMO_EXIT_CODE."
134111 echo "demo_outcome=failure" >> $GITHUB_OUTPUT
135112 cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt
136113 exit 1
137114 fi
138-
139115 - name : Archive Demo Output
140116 if : always()
141117 uses : actions/upload-artifact@v4
0 commit comments