Skip to content

Commit e167578

Browse files
author
Aliaksandr Adziareika
committed
Check setup python output
1 parent 3846ff6 commit e167578

File tree

1 file changed

+143
-3
lines changed

1 file changed

+143
-3
lines changed

.github/workflows/test-python-setup.yml

Lines changed: 143 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ on:
55
pull_request:
66
paths:
77
- '.github/workflows/test-python-setup.yml'
8-
push:
9-
paths:
10-
- '.github/workflows/test-python-setup.yml'
8+
# push:
9+
# paths:
10+
# - '.github/workflows/test-python-setup.yml'
1111

1212
jobs:
1313
test-setup-python:
14+
if: false
1415
runs-on: ${{ matrix.runner }}
1516
name: ${{ matrix.runner }} / ${{ matrix.architecture }}
1617
strategy:
@@ -200,6 +201,7 @@ jobs:
200201
fi
201202
202203
test-apt-python-i386:
204+
if: false
203205
runs-on: ubuntu-latest
204206
name: Ubuntu apt i386
205207
steps:
@@ -248,3 +250,141 @@ jobs:
248250
249251
echo "| ${ver} | ${STATUS} | ${DEV_STATUS} |" >> $GITHUB_STEP_SUMMARY
250252
done
253+
254+
255+
test-setup-python-versions:
256+
strategy:
257+
fail-fast: false
258+
matrix:
259+
include:
260+
- runner: ubuntu-latest
261+
architecture: x86
262+
- runner: ubuntu-latest
263+
architecture: x64
264+
- runner: ubuntu-24.04-arm
265+
architecture: arm64
266+
- runner: macos-latest
267+
architecture: arm64
268+
- runner: macos-14
269+
architecture: arm64
270+
- runner: macos-15-intel
271+
architecture: x64
272+
- runner: macos-15
273+
architecture: arm64
274+
- runner: windows-latest
275+
architecture: x86
276+
- runner: windows-latest
277+
architecture: x64
278+
name: ${{ matrix.runner }} / ${{ matrix.architecture }}
279+
runs-on: ${{ matrix.runner }}
280+
env:
281+
PYTHON_VERSIONS: |
282+
3.8
283+
3.9
284+
3.10
285+
3.11
286+
3.12
287+
3.13
288+
3.14
289+
290+
steps:
291+
- name: Install tree (Windows)
292+
if: runner.os == 'Windows'
293+
run: choco install tree -y
294+
295+
- name: Install tree (macOS)
296+
if: runner.os == 'macOS'
297+
run: which tree || brew install tree
298+
299+
- name: Set tool cache path
300+
id: tool-cache
301+
shell: bash
302+
run: |
303+
if [ "$RUNNER_OS" == "macOS" ]; then
304+
TOOL_CACHE="/Users/runner/hostedtoolcache"
305+
else
306+
TOOL_CACHE="$RUNNER_TOOL_CACHE"
307+
fi
308+
# Convert to unix path on Windows
309+
if command -v cygpath &> /dev/null; then
310+
TOOL_CACHE=$(cygpath -u "$TOOL_CACHE")
311+
fi
312+
echo "tool-cache-unix=$TOOL_CACHE" >> $GITHUB_OUTPUT
313+
314+
- name: List tool cache (before)
315+
shell: bash
316+
run: |
317+
echo "TOOL_CACHE: ${{ steps.tool-cache.outputs.tool-cache-unix }}"
318+
tree -L 2 -pughD "${{ steps.tool-cache.outputs.tool-cache-unix }}/Python" 2>/dev/null || echo "No Python in cache yet"
319+
320+
- name: Setup Python
321+
id: setup-python
322+
uses: actions/setup-python@v5
323+
with:
324+
python-version: ${{ env.PYTHON_VERSIONS }}
325+
architecture: ${{ matrix.architecture }}
326+
327+
- name: List tool cache (after)
328+
shell: bash
329+
run: |
330+
echo "TOOL_CACHE: ${{ steps.tool-cache.outputs.tool-cache-unix }}"
331+
tree -L 2 -pughD "${{ steps.tool-cache.outputs.tool-cache-unix }}/Python" 2>/dev/null || echo "No Python in cache"
332+
echo ""
333+
echo "setup-python outputs:"
334+
echo " python-version: ${{ steps.setup-python.outputs.python-version }}"
335+
echo " python-path: ${{ steps.setup-python.outputs.python-path }}"
336+
echo ""
337+
echo "which python versions:"
338+
echo -n " python: "
339+
which python 2>/dev/null || echo "not found"
340+
for v in 3.8 3.9 3.10 3.11 3.12 3.13 3.14; do
341+
echo -n " python$v: "
342+
which python$v 2>/dev/null || echo "not found"
343+
done
344+
345+
if [ "$RUNNER_OS" == "Windows" ]; then
346+
echo ""
347+
echo "py --list-paths:"
348+
py --list-paths
349+
fi
350+
351+
test-setup-python-versions-empty:
352+
strategy:
353+
fail-fast: false
354+
matrix:
355+
include:
356+
- runner: ubuntu-latest
357+
architecture: x86
358+
- runner: ubuntu-latest
359+
architecture: x64
360+
- runner: ubuntu-24.04-arm
361+
architecture: arm64
362+
- runner: macos-latest
363+
architecture: arm64
364+
- runner: macos-14
365+
architecture: arm64
366+
- runner: macos-15-intel
367+
architecture: x64
368+
- runner: macos-15
369+
architecture: arm64
370+
- runner: windows-latest
371+
architecture: x86
372+
- runner: windows-latest
373+
architecture: x64
374+
375+
name: ${{ matrix.runner }} / ${{ matrix.architecture }} / empty version
376+
runs-on: ${{ matrix.runner }}
377+
378+
steps:
379+
- name: Setup Python with empty version
380+
id: setup-python
381+
uses: actions/setup-python@v5
382+
with:
383+
architecture: ${{ matrix.architecture }}
384+
385+
- name: List tool cache (after)
386+
shell: bash
387+
run: |
388+
echo "setup-python outputs:"
389+
echo " python-version: ${{ steps.setup-python.outputs.python-version }}"
390+
echo " python-path: ${{ steps.setup-python.outputs.python-path }}"

0 commit comments

Comments
 (0)