1- # .github/workflows/numpy-scipy-c-extension-test.yml
21name : 🧬 NumPy + SciPy C-Extension Switching Test
32
43on :
1110 runs-on : ubuntu-latest
1211 permissions :
1312 contents : write
14-
1513 services :
1614 redis :
1715 image : redis:7
@@ -32,10 +30,10 @@ jobs:
3230 with :
3331 python-version : ' 3.11'
3432
35- - name : 📦 Install omnipkg (editable) and Redis client
33+ - name : 📦 Install dependencies
3634 run : |
3735 python -m pip install --upgrade pip
38- pip install -e . redis
36+ pip install -e . redis numpy==1.26.4 scipy==1.13.0
3937
4038 - name : ⚙️ Configure omnipkg for non-interactive use
4139 run : |
@@ -85,49 +83,105 @@ jobs:
8583 sys.exit(1)
8684 EOF
8785
88- - name : 🧪 Run the Demo: NumPy + SciPy Stress Test (C-Extensions)
86+ - name : 🧪 Run the Demo - NumPy + SciPy Stress Test (C-Extensions)
8987 id : run_demo
9088 run : |
9189 echo "--- Running Omnipkg Demo for NumPy + SciPy Stress Test (C-Extensions) ---"
9290 mkdir -p /tmp/omnipkg-artifacts
9391
94- # Simulate user input '3' for NumPy + SciPy test, capture output, and limit runtime
95- timeout 600 bash -c 'echo "3" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/demo_output.txt' # Increased timeout for heavy packages
92+ timeout 600 bash -c 'echo "3" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt'
9693 DEMO_EXIT_CODE=$?
9794
9895 echo "## NumPy + SciPy Demo Output" >> $GITHUB_STEP_SUMMARY
9996 echo '```' >> $GITHUB_STEP_SUMMARY
100- cat /tmp/omnipkg-artifacts/demo_output .txt >> $GITHUB_STEP_SUMMARY
97+ cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output .txt >> $GITHUB_STEP_SUMMARY
10198 echo '```' >> $GITHUB_STEP_SUMMARY
10299
103100 if [ $DEMO_EXIT_CODE -eq 0 ]; then
104101 echo "Demo completed successfully."
105102 echo "demo_outcome=success" >> $GITHUB_OUTPUT
106- # Verify key NumPy/SciPy demo outputs
107- if grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/demo_output.txt && \
108- grep -q "NUMPY VERSION JUGGLING:" /tmp/omnipkg-artifacts/demo_output.txt && \
109- grep -q "SCIPY C-EXTENSION TEST:" /tmp/omnipkg-artifacts/demo_output.txt && \
110- grep -q "NUMPY + SCIPY VERSION MIXING:" /tmp/omnipkg-artifacts/demo_output.txt && \
111- grep -q "OMNIPKG SURVIVED NUCLEAR TESTING!" /tmp/omnipkg-artifacts/demo_output.txt; then
112- echo "NumPy + SciPy demo verified: All tests passed, including C-extension handling and version mixing."
103+ if grep -q "numpy==1.26.4" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
104+ grep -q "scipy==1.13.0" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
105+ grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
106+ grep -q "NUMPY VERSION JUGGLING:" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
107+ grep -q "SCIPY C-EXTENSION TEST:" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
108+ grep -q "NUMPY + SCIPY VERSION MIXING:" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
109+ grep -q "OMNIPKG SURVIVED NUCLEAR TESTING!" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt; then
110+ echo "NumPy + SciPy demo verified: numpy==1.26.4, scipy==1.13.0, all tests passed, and version mixing succeeded!"
113111 else
114112 echo "Error: Expected NumPy + SciPy demo output not found."
115- echo "Missing one of: 'ALL TESTS PASSED!', 'NUMPY VERSION JUGGLING:', 'SCIPY C-EXTENSION TEST:', 'NUMPY + SCIPY VERSION MIXING:', or 'OMNIPKG SURVIVED NUCLEAR TESTING!'"
116- cat /tmp/omnipkg-artifacts/demo_output .txt
113+ echo "Missing one of: 'numpy==1.26.4', 'scipy==1.13.0', ' ALL TESTS PASSED!', 'NUMPY VERSION JUGGLING:', 'SCIPY C-EXTENSION TEST:', 'NUMPY + SCIPY VERSION MIXING:', or 'OMNIPKG SURVIVED NUCLEAR TESTING!'"
114+ cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output .txt
117115 exit 1
118116 fi
119117 else
120118 echo "Demo failed with exit code $DEMO_EXIT_CODE."
121119 echo "demo_outcome=failure" >> $GITHUB_OUTPUT
122- cat /tmp/omnipkg-artifacts/demo_output .txt
120+ cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output .txt
123121 exit 1
124122 fi
125123
126- - name : 📦 Archive Demo Output
124+ - name : 📊 Check Omnipkg Status
125+ id : check_status
126+ run : |
127+ echo "--- Checking Omnipkg Status ---"
128+ mkdir -p /tmp/omnipkg-artifacts
129+ omnipkg status > /tmp/omnipkg-artifacts/status_output.txt
130+ echo "## Omnipkg Status Output" >> $GITHUB_STEP_SUMMARY
131+ echo '```' >> $GITHUB_STEP_SUMMARY
132+ cat /tmp/omnipkg-artifacts/status_output.txt >> $GITHUB_STEP_SUMMARY
133+ echo '```' >> $GITHUB_STEP_SUMMARY
134+
135+ if grep -q "numpy-1.26.4" /tmp/omnipkg-artifacts/status_output.txt && \
136+ grep -q "scipy-1.13.0" /tmp/omnipkg-artifacts/status_output.txt; then
137+ echo "Status verified: NumPy and SciPy bubbles found!"
138+ else
139+ echo "Error: Expected NumPy and SciPy bubbles not found in status output."
140+ cat /tmp/omnipkg-artifacts/status_output.txt
141+ exit 1
142+ fi
143+
144+ - name : 📊 Generate Report
145+ if : always()
146+ run : |
147+ REPORT_FILE="/tmp/omnipkg-artifacts/numpy_scipy_test_report.md"
148+ echo "# 🧬 NumPy + SciPy C-Extension Switching Test Report" > $REPORT_FILE
149+ echo "" >> $REPORT_FILE
150+ echo "**Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $REPORT_FILE
151+ echo "**Test Status:** \`${{ job.status }}\`" >> $REPORT_FILE
152+ echo "" >> $REPORT_FILE
153+
154+ echo "## Demo Execution Output" >> $REPORT_FILE
155+ echo "\`\`\`" >> $REPORT_FILE
156+ cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt 2>/dev/null || echo 'N/A: Demo output missing.' >> $REPORT_FILE
157+ echo "\`\`\`" >> $REPORT_FILE
158+ echo "" >> $REPORT_FILE
159+
160+ echo "## Omnipkg Status Output" >> $REPORT_FILE
161+ echo "\`\`\`" >> $REPORT_FILE
162+ cat /tmp/omnipkg-artifacts/status_output.txt 2>/dev/null || echo 'N/A: Status output missing.' >> $REPORT_FILE
163+ echo "\`\`\`" >> $REPORT_FILE
164+ echo "" >> $REPORT_FILE
165+
166+ echo "## Conclusion" >> $REPORT_FILE
167+ if [ "${{ steps.run_demo.outputs.demo_outcome }}" == "success" ]; then
168+ echo "✅ **omnipkg successfully demonstrated seamless version switching for C-extension packages (NumPy + SciPy).** This test confirms omnipkg's ability to handle complex C-extension dependencies with high integrity." >> $REPORT_FILE
169+ else
170+ echo "❌ The NumPy + SciPy C-Extension Switching Test failed. Review workflow logs for detailed output and errors." >> $REPORT_FILE
171+ fi
172+ echo "" >> $REPORT_FILE
173+
174+ - name : 🧹 Clean Up Redis
175+ if : always()
176+ run : |
177+ echo "--- Cleaning Up Redis ---"
178+ redis-cli -h localhost -p 6379 KEYS "omnipkg:pkg:*" | xargs -r redis-cli -h localhost -p 6379 DEL
179+
180+ - name : 📦 Upload Artifacts
127181 if : always()
128182 uses : actions/upload-artifact@v4
129183 with :
130- name : omnipkg-numpy-scipy-demo-output
184+ name : omnipkg-numpy-scipy-outputs
131185 path : /tmp/omnipkg-artifacts/
132- retention-days : 7
186+ retention-days : 30
133187 compression-level : 6
0 commit comments