Skip to content

Commit 6aab4f2

Browse files
authored
Update numpy-scipy-c-extension-test.yml
1 parent b8c1971 commit 6aab4f2

1 file changed

Lines changed: 21 additions & 89 deletions

File tree

Lines changed: 21 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
name: 🧬 NumPy + SciPy C-Extension Switching Test
1+
name: NumPy + SciPy C-Extension Switching
22

33
on:
4-
workflow_dispatch:
54
push:
6-
branches: ['main']
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
workflow_dispatch:
79

810
jobs:
9-
run-numpy-scipy-test:
11+
test:
1012
runs-on: ubuntu-latest
11-
permissions:
12-
contents: write
1313
services:
1414
redis:
1515
image: redis:7
@@ -22,20 +22,20 @@ jobs:
2222
- 6379:6379
2323

2424
steps:
25-
- name: 🏁 Checkout repository
25+
- name: Checkout repository
2626
uses: actions/checkout@v4
2727

28-
- name: 🐍 Set up Python 3.11
28+
- name: Set up Python 3.11
2929
uses: actions/setup-python@v5
3030
with:
3131
python-version: '3.11'
3232

33-
- name: 📦 Install dependencies
33+
- name: Install dependencies
3434
run: |
3535
python -m pip install --upgrade pip
3636
pip install -e . redis numpy==1.26.4 scipy==1.13.0
3737
38-
- name: ⚙️ Configure omnipkg
38+
- name: Configure omnipkg for non-interactive use
3939
run: |
4040
python - << 'EOF'
4141
import sys
@@ -51,6 +51,7 @@ jobs:
5151
site_packages_path = sysconfig.get_paths()['purelib']
5252
5353
project_root = Path(os.environ['GITHUB_WORKSPACE'])
54+
5455
builder_script = project_root / 'omnipkg' / 'package_meta_builder.py'
5556
if not builder_script.exists():
5657
print(f"Error: {builder_script} does not exist")
@@ -83,46 +84,33 @@ jobs:
8384
sys.exit(1)
8485
EOF
8586
86-
- name: 🧪 Debug Environment
87-
run: |
88-
echo "--- Debugging Environment ---"
89-
python --version
90-
pip show omnipkg redis numpy scipy
91-
redis-cli -h localhost -p 6379 ping
92-
93-
- name: 🧪 Run the Demo - NumPy + SciPy Stress Test
87+
- name: Run the Demo - NumPy + SciPy Stress Test
9488
id: run_demo
9589
run: |
9690
echo "--- Running Omnipkg Demo for NumPy + SciPy Stress Test (C-Extensions) ---"
9791
mkdir -p /tmp/omnipkg-artifacts
9892
99-
set -o pipefail
100-
timeout 600 bash -c 'echo "3" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt; exit ${PIPESTATUS[0]}'
93+
timeout 900 bash -c 'echo "3" | omnipkg demo 2>&1 | tee /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt'
10194
DEMO_EXIT_CODE=$?
10295
103-
echo "DEBUG: omnipkg demo exit code: $DEMO_EXIT_CODE"
10496
echo "## NumPy + SciPy Demo Output" >> $GITHUB_STEP_SUMMARY
10597
echo '```' >> $GITHUB_STEP_SUMMARY
10698
cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt >> $GITHUB_STEP_SUMMARY
10799
echo '```' >> $GITHUB_STEP_SUMMARY
108100
109-
if [ $DEMO_EXIT_CODE -eq 0 ] || \
110-
(grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
111-
grep -q "OMNIPKG SURVIVED NUCLEAR TESTING" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
112-
grep -q "Demo completed successfully" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt); then
113-
echo "Demo completed successfully (exit code $DEMO_EXIT_CODE, logs verified)."
101+
if [ $DEMO_EXIT_CODE -eq 0 ]; then
102+
echo "Demo completed successfully."
114103
echo "demo_outcome=success" >> $GITHUB_OUTPUT
115104
if grep -q "numpy==1.26.4" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
116105
grep -q "scipy==1.13.0" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
117106
grep -q "numpy==1.24.3" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
118107
grep -q "scipy==1.16.1" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
119108
grep -q "ALL TESTS PASSED!" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
120-
grep -q "OMNIPKG SURVIVED NUCLEAR TESTING" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt && \
121-
grep -q "Cleanup complete" /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt; then
122-
echo "NumPy + SciPy demo verified: numpy==1.26.4, 1.24.3, scipy==1.13.0, 1.16.1, all tests passed, cleanup complete!"
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, 1.24.3, scipy==1.13.0, 1.16.1, all tests passed!"
123111
else
124112
echo "Error: Expected NumPy + SciPy demo output not found."
125-
echo "Missing one of: 'numpy==1.26.4', 'scipy==1.13.0', 'numpy==1.24.3', 'scipy==1.16.1', 'ALL TESTS PASSED!', 'OMNIPKG SURVIVED NUCLEAR TESTING', or 'Cleanup complete'"
113+
echo "Missing one of: 'numpy==1.26.4', 'scipy==1.13.0', 'numpy==1.24.3', 'scipy==1.16.1', 'ALL TESTS PASSED!', or 'OMNIPKG SURVIVED NUCLEAR TESTING'"
126114
cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt
127115
exit 1
128116
fi
@@ -133,67 +121,11 @@ jobs:
133121
exit 1
134122
fi
135123
136-
- name: 📊 Check Omnipkg Status
137-
id: check_status
138-
run: |
139-
echo "--- Checking Omnipkg Status ---"
140-
mkdir -p /tmp/omnipkg-artifacts
141-
omnipkg status > /tmp/omnipkg-artifacts/status_output.txt
142-
echo "## Omnipkg Status Output" >> $GITHUB_STEP_SUMMARY
143-
echo '```' >> $GITHUB_STEP_SUMMARY
144-
cat /tmp/omnipkg-artifacts/status_output.txt >> $GITHUB_STEP_SUMMARY
145-
echo '```' >> $GITHUB_STEP_SUMMARY
146-
147-
if grep -q "numpy-1.24.3" /tmp/omnipkg-artifacts/status_output.txt && \
148-
grep -q "scipy-1.16.1" /tmp/omnipkg-artifacts/status_output.txt; then
149-
echo "Status verified: NumPy and SciPy bubbles found!"
150-
else
151-
echo "Error: Expected NumPy and SciPy bubbles not found in status output."
152-
cat /tmp/omnipkg-artifacts/status_output.txt
153-
exit 1
154-
fi
155-
156-
- name: 📊 Generate Report
157-
if: always()
158-
run: |
159-
REPORT_FILE="/tmp/omnipkg-artifacts/numpy_scipy_test_report.md"
160-
echo "# 🧬 NumPy + SciPy C-Extension Switching Test Report" > $REPORT_FILE
161-
echo "" >> $REPORT_FILE
162-
echo "**Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $REPORT_FILE
163-
echo "**Test Status:** \`${{ job.status }}\`" >> $REPORT_FILE
164-
echo "" >> $REPORT_FILE
165-
166-
echo "## Demo Execution Output" >> $REPORT_FILE
167-
echo "\`\`\`" >> $REPORT_FILE
168-
cat /tmp/omnipkg-artifacts/numpy_scipy_demo_output.txt 2>/dev/null || echo 'N/A: Demo output missing.' >> $REPORT_FILE
169-
echo "\`\`\`" >> $REPORT_FILE
170-
echo "" >> $REPORT_FILE
171-
172-
echo "## Omnipkg Status Output" >> $REPORT_FILE
173-
echo "\`\`\`" >> $REPORT_FILE
174-
cat /tmp/omnipkg-artifacts/status_output.txt 2>/dev/null || echo 'N/A: Status output missing.' >> $REPORT_FILE
175-
echo "\`\`\`" >> $REPORT_FILE
176-
echo "" >> $REPORT_FILE
177-
178-
echo "## Conclusion" >> $REPORT_FILE
179-
if [ "${{ steps.run_demo.outputs.demo_outcome }}" == "success" ]; then
180-
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
181-
else
182-
echo "❌ The NumPy + SciPy C-Extension Switching Test failed. Review workflow logs for detailed output and errors." >> $REPORT_FILE
183-
fi
184-
echo "" >> $REPORT_FILE
185-
186-
- name: 🧹 Clean Up Redis
187-
if: always()
188-
run: |
189-
echo "--- Cleaning Up Redis ---"
190-
redis-cli -h localhost -p 6379 KEYS "omnipkg:pkg:*" | xargs -r redis-cli -h localhost -p 6379 DEL
191-
192-
- name: 📦 Upload Artifacts
124+
- name: Archive Demo Output
193125
if: always()
194126
uses: actions/upload-artifact@v4
195127
with:
196-
name: omnipkg-numpy-scipy-outputs
128+
name: omnipkg-numpy-scipy-demo-output
197129
path: /tmp/omnipkg-artifacts/
198-
retention-days: 30
130+
retention-days: 7
199131
compression-level: 6

0 commit comments

Comments
 (0)