@@ -27,11 +27,15 @@ jobs:
2727 ]
2828 EOF
2929
30+ - name : Install uv
31+ run : |
32+ curl -LsSf https://astral.sh/uv/install.sh | sh
33+ export PATH="$HOME/.local/bin:$PATH"
34+
3035 - name : Generate lock file
3136 working-directory : test-project
3237 run : |
33- curl -LsSf https://astral.sh/uv/install.sh | sh
34- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
38+ export PATH="$HOME/.local/bin:$PATH"
3539 uv sync
3640
3741 - name : Test basic usage
@@ -58,19 +62,25 @@ jobs:
5862 ]
5963 EOF
6064
61- - name : Generate lock and requirements files
65+ - name : Install uv
6266 working-directory : test-project
6367 run : |
6468 curl -LsSf https://astral.sh/uv/install.sh | sh
65- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
69+ export PATH="$HOME/.local/bin:$PATH"
70+
71+ - name : Generate lock and requirements files
72+ working-directory : test-project
73+ run : |
74+ export PATH="$HOME/.local/bin:$PATH"
6675 uv sync
6776 uv pip compile pyproject.toml -o requirements.txt
6877
6978 - name : Test with requirements
7079 uses : ./
7180 with :
7281 pyproject-path : test-project/pyproject.toml
73- requirements-path : test-project/requirements.txt
82+ requirements-path : requirements.txt
83+ requirements-command : uv pip compile pyproject.toml -o requirements.txt
7484
7585 test-custom-requirements :
7686 runs-on : ubuntu-latest
@@ -91,27 +101,30 @@ jobs:
91101 ]
92102 EOF
93103
94- - name : Generate lock and platform-specific requirements
104+ - name : Install uv
95105 working-directory : test-project
96106 run : |
97107 curl -LsSf https://astral.sh/uv/install.sh | sh
98- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
108+ export PATH="$HOME/.local/bin:$PATH"
109+ - name : Generate lock and platform-specific requirements
110+ working-directory : test-project
111+ run : |
112+ export PATH="$HOME/.local/bin:$PATH"
99113 uv sync
100114 uv pip compile --python-platform=linux pyproject.toml -o requirements-linux.txt
101115
102116 - name : Test with custom requirements command
103117 uses : ./
104118 with :
105119 pyproject-path : test-project/pyproject.toml
106- requirements-path : test-project/ requirements-linux.txt
120+ requirements-path : requirements-linux.txt
107121 requirements-command : uv pip compile --python-platform=linux pyproject.toml -o requirements-linux.txt
108122
109- test-failure :
123+ test-requirements- failure :
110124 runs-on : ubuntu-latest
111125 steps :
112126 - uses : actions/checkout@v4
113-
114- - name : Create test project
127+ - name : Setup test project
115128 run : |
116129 mkdir -p test-project
117130 cat > test-project/pyproject.toml << EOF
@@ -124,21 +137,110 @@ jobs:
124137 "pytest>=7.4.0",
125138 ]
126139 EOF
127-
128- - name : Generate lock file
140+ - name : Install uv
141+ run : |
142+ curl -LsSf https://astral.sh/uv/install.sh | sh
143+ export PATH="$HOME/.local/bin:$PATH"
144+ - name : Generate requirements.txt
129145 working-directory : test-project
146+ run : |
147+ export PATH="$HOME/.local/bin:$PATH"
148+ uv pip compile pyproject.toml -o requirements.txt
149+ - name : Modify pyproject.toml
150+ run : |
151+ sed -i 's/pytest>=7.4.0/pytest>=7.5.0/' test-project/pyproject.toml
152+ - uses : ./
153+ with :
154+ pyproject-path : test-project/pyproject.toml
155+ requirements-path : requirements.txt
156+ requirements-command : uv pip compile pyproject.toml -o requirements.txt
157+
158+ test-uv-lock-failure :
159+ runs-on : ubuntu-latest
160+ steps :
161+ - uses : actions/checkout@v4
162+ - name : Setup test project
163+ run : |
164+ mkdir -p test-project
165+ cat > test-project/pyproject.toml << EOF
166+ [project]
167+ name = "test-project"
168+ version = "0.1.0"
169+ requires-python = ">=3.9"
170+ dependencies = [
171+ "requests>=2.31.0",
172+ "pytest>=7.4.0",
173+ ]
174+ EOF
175+ - name : Install uv
130176 run : |
131177 curl -LsSf https://astral.sh/uv/install.sh | sh
132- echo "$HOME/.cargo/bin" >> $GITHUB_PATH
178+ export PATH="$HOME/.local/bin:$PATH"
179+ - name : Generate uv.lock
180+ working-directory : test-project
181+ run : |
182+ export PATH="$HOME/.local/bin:$PATH"
133183 uv sync
134-
135- - name : Modify pyproject.toml to cause failure
184+ - name : Modify pyproject.toml
185+ run : |
186+ sed -i 's/pytest>=7.4.0/pytest>=7.5.0/' test-project/pyproject.toml
187+ - name : Update uv.lock
136188 working-directory : test-project
137189 run : |
138- sed -i 's/requests>=2.31.0/requests>=2.32.0/' pyproject.toml
139-
140- - name : Test failure case
190+ export PATH="$HOME/.local/bin:$PATH"
191+ uv sync
192+ - uses : ./
193+ with :
194+ pyproject-path : test-project/pyproject.toml
195+ requirements-path : requirements.txt
196+ requirements-command : uv pip compile pyproject.toml -o requirements.txt -- --platform linux
197+
198+ test-multiple-requirements :
199+ runs-on : ubuntu-latest
200+ steps :
201+ - uses : actions/checkout@v4
202+ - name : Create test project
203+ run : |
204+ mkdir -p test-project
205+ cat > test-project/pyproject.toml << EOF
206+ [project]
207+ name = "test-project"
208+ version = "0.1.0"
209+ requires-python = ">=3.9"
210+ dependencies = [
211+ "requests>=2.31.0",
212+ "pytest>=7.4.0",
213+ ]
214+ EOF
215+ - name : Install uv
216+ working-directory : test-project
217+ run : |
218+ curl -LsSf https://astral.sh/uv/install.sh | sh
219+ export PATH="$HOME/.local/bin:$PATH"
220+ - name : Print uv version
221+ working-directory : test-project
222+ run : |
223+ export PATH="$HOME/.local/bin:$PATH"
224+ uv --version
225+ - name : Generate requirements-linux.txt
226+ working-directory : test-project
227+ run : |
228+ export PATH="$HOME/.local/bin:$PATH"
229+ uv pip compile --python-platform=linux pyproject.toml -o requirements-linux.txt
230+ - name : Generate requirements-win.txt
231+ working-directory : test-project
232+ run : |
233+ export PATH="$HOME/.local/bin:$PATH"
234+ uv pip compile --python-platform=windows pyproject.toml -o requirements-win.txt
235+ - name : Check Linux Requirements
141236 uses : ./
142- continue-on-error : true
143237 with :
144- pyproject-path : test-project/pyproject.toml
238+ pyproject-path : test-project/pyproject.toml
239+ requirements-command : uv pip compile --python-platform=linux pyproject.toml -o requirements-linux.txt
240+ requirements-path : requirements-linux.txt
241+ - name : Check Windows Requirements
242+ uses : ./
243+ with :
244+ pyproject-path : test-project/pyproject.toml
245+ requirements-command : uv pip compile --python-platform=windows pyproject.toml -o requirements-win.txt
246+ requirements-path : requirements-win.txt
0 commit comments