@@ -5,16 +5,37 @@ name: Build and Test Python Package
55on :
66 pull_request :
77 branches : ["main"]
8- push :
9- branches : ["main"]
8+ workflow_call :
109
1110env :
1211 PYTHON_VERSION : " 3.10"
1312
1413jobs :
14+ build-package :
15+ name : Build Package
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Check out the repo
19+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
21+ - name : Build package
22+ uses : ./.github/actions/python-package-build
23+ id : build
24+ with :
25+ uv-version : " 0.8.22"
26+ python-version : " $PYTHON_VERSION"
27+
28+ - name : Upload package artifact
29+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
30+ with :
31+ name : python-package-${{ github.sha }}
32+ path : dist/
33+ retention-days : 1
34+
1535 test-build-package-extras :
1636 name : Test package build ${{ matrix.name}}
1737 runs-on : ubuntu-latest
38+ needs : build-package
1839 permissions :
1940 contents : read
2041 strategy :
@@ -32,35 +53,43 @@ jobs:
3253 - name : Check out the repo
3354 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3455
35- - name : Build package
36- uses : ./.github/actions/python-package-build
37- id : build
56+ - name : Download package artifact
57+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
3858 with :
39- uv-version : " 0.8.22"
40- python-version : " $PYTHON_VERSION"
59+ name : python-package-${{ github.sha }}
60+ path : dist/
61+
62+ - name : Install uv
63+ uses : astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
64+
4165 - name : Test package
4266 run : |
4367 uv venv --python $PYTHON_VERSION
44- uv pip install "${{ steps.build.outputs.wheel-file }}[${{ matrix.name }}]"
68+ WHEEL_FILE=$(ls dist/*.whl)
69+ uv pip install "$WHEEL_FILE[${{ matrix.name }}]"
4570 uv run ${{ matrix.test-args }}
4671
47- test-build-package :
72+ test-build-package-no-extras :
4873 name : Test package build no extras
4974 runs-on : ubuntu-latest
75+ needs : build-package
5076 permissions :
5177 contents : read
5278 steps :
5379 - name : Check out the repo
5480 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5581
56- - name : Build package
57- uses : ./.github/actions/python-package-build
58- id : build
82+ - name : Download package artifact
83+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
5984 with :
60- uv-version : " 0.8.22"
61- python-version : " $PYTHON_VERSION"
85+ name : python-package-${{ github.sha }}
86+ path : dist/
87+ - name : Install uv
88+ uses : astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
89+
6290 - name : Test package
6391 run : |
6492 uv venv --python $PYTHON_VERSION
65- uv pip install "${{ steps.build.outputs.wheel-file }}"
93+ WHEEL_FILE=$(ls dist/*.whl)
94+ uv pip install "$WHEEL_FILE"
6695 uv run python -c 'import twyn; twyn.check_dependencies()'
0 commit comments