-
Notifications
You must be signed in to change notification settings - Fork 3
172 lines (144 loc) · 4.37 KB
/
Copy pathtest.yml
File metadata and controls
172 lines (144 loc) · 4.37 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Test UV Installation Detection
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
# Reduce matrix size for faster CI
- os: windows-latest
python-version: "3.9"
- os: windows-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.9"
- os: macos-latest
python-version: "3.10"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
- name: Set up Python with uv
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
uv venv
uv pip install pytest pytest-mock
- name: Install package in development mode
run: uv pip install -e .
- name: Run unit tests
run: uv run pytest test_detection.py -v
- name: Test uvhow CLI directly
run: |
uv run uvhow
uv run python -m uvhow
- name: Test with different uv installation methods (Unix)
if: runner.os != 'Windows'
run: |
# Test current installation
echo "=== Current uv installation ==="
uv run uvhow
# Test if we can detect the current method
echo "=== Testing detection ==="
which uv
uv --version
- name: Test with different uv installation methods (Windows)
if: runner.os == 'Windows'
run: |
# Test current installation
echo "=== Current uv installation ==="
uv run uvhow
# Test if we can detect the current method
echo "=== Testing detection ==="
where uv
uv --version
test-installation-methods:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
method: [pip, standalone]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uvhow
run: pip install -e .
- name: Test pip installation method
if: matrix.method == 'pip'
run: |
# Install uv via pip to test detection
pip install uv
python -m uvhow
- name: Test standalone installation method
if: matrix.method == 'standalone'
run: |
# Install uv via standalone installer
if [ "$RUNNER_OS" == "Windows" ]; then
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
echo "$env:USERPROFILE\\.local\\bin" >> $GITHUB_PATH
else
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
fi
shell: bash
- name: Test detection after standalone install
if: matrix.method == 'standalone'
run: |
# Reload PATH and test
python -m uvhow
shell: bash
test-package-managers:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
package-manager: homebrew
- os: windows-latest
package-manager: scoop
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install uvhow
run: pip install -e .
- name: Install via Homebrew
if: matrix.package-manager == 'homebrew'
run: |
brew install uv
- name: Install via Scoop
if: matrix.package-manager == 'scoop'
run: |
# Install Scoop
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
irm get.scoop.sh | iex
scoop bucket add main
scoop install uv
# Add scoop shims to PATH for subsequent steps
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
shell: powershell
- name: Test detection
run: python -m uvhow
shell: bash