-
-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (86 loc) · 3.45 KB
/
Copy pathadoption_test.yml
File metadata and controls
105 lines (86 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: "Simple Python Adoption Test"
on:
push:
branches: [ development ]
pull_request:
branches: [ development ]
workflow_dispatch:
jobs:
test-python-adoption:
runs-on: ubuntu-latest
services:
redis:
image: redis:7
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11 (base environment)
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e . redis
- name: Test Basic Python Adoption and Swapping
id: full_test_run
run: |
set -e
echo "=== Testing Basic Python Management ==="
# Set consistent config path
export OMNIPKG_CONFIG_PATH="${{ github.workspace }}/.omnipkg_config/config.json"
echo "Config path: $OMNIPKG_CONFIG_PATH"
# Initialize omnipkg config (let the CLI handle it)
echo "--- Initializing omnipkg ---"
echo "Omnipkg will auto-initialize on first command"
# Adopt Python 3.11 (current)
echo "--- Adopting Python 3.11 ---"
omnipkg python adopt 3.11
# Check current status
echo "--- Checking Python info ---"
omnipkg info python
# Adopt Python 3.9
echo "--- Adopting Python 3.9 ---"
omnipkg python adopt 3.9
# List available interpreters
echo "--- Listing managed interpreters ---"
omnipkg list python
# Test swapping to Python 3.9
echo "--- Swapping to Python 3.9 ---"
omnipkg swap python 3.9
# Verify the swap worked
echo "--- Verifying Python 3.9 is active ---"
omnipkg info python
# Re-adopt Python 3.11 to ensure it's in the current context
echo "--- Re-adopting Python 3.11 to restore context ---"
omnipkg python adopt 3.11
# Test swapping back to Python 3.11
echo "--- Swapping back to Python 3.11 ---"
omnipkg swap python 3.11
# Final verification
echo "--- Final verification ---"
omnipkg info python
echo "✅ All basic Python adoption and swapping tests passed!"
- name: Test Summary
if: always()
run: |
echo "## Test Results Summary" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.full_test_run.outcome }}" == "success" ]]; then
echo "✅ **Simple Python Adoption Test: PASSED**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Successfully tested:" >> $GITHUB_STEP_SUMMARY
echo "- Python interpreter adoption (3.11 and 3.9)" >> $GITHUB_STEP_SUMMARY
echo "- Context switching between interpreters" >> $GITHUB_STEP_SUMMARY
echo "- Basic omnipkg info and list commands" >> $GITHUB_STEP_SUMMARY
else
echo "❌ **Simple Python Adoption Test: FAILED**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Check the workflow logs for details." >> $GITHUB_STEP_SUMMARY
fi