@@ -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,46 @@ 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+ with :
65+ version : " 0.8.22"
4166 - name : Test package
4267 run : |
4368 uv venv --python $PYTHON_VERSION
44- uv pip install "${{ steps.build.outputs.wheel-file }}[${{ matrix.name }}]"
69+ WHEEL_FILE=$(ls dist/*.whl)
70+ uv pip install "$WHEEL_FILE[${{ matrix.name }}]"
4571 uv run ${{ matrix.test-args }}
4672
47- test-build-package :
73+ test-build-package-no-extras :
4874 name : Test package build no extras
4975 runs-on : ubuntu-latest
76+ needs : build-package
5077 permissions :
5178 contents : read
5279 steps :
5380 - name : Check out the repo
5481 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5582
56- - name : Build package
57- uses : ./.github/actions/python-package-build
58- id : build
83+ - name : Download package artifact
84+ uses : actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
5985 with :
60- uv-version : " 0.8.22"
61- python-version : " $PYTHON_VERSION"
86+ name : python-package-${{ github.sha }}
87+ path : dist/
88+ - name : Install uv
89+ uses : astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098 # v7.3.1
90+ with :
91+ version : " 0.8.22"
92+
6293 - name : Test package
6394 run : |
6495 uv venv --python $PYTHON_VERSION
65- uv pip install "${{ steps.build.outputs.wheel-file }}"
96+ WHEEL_FILE=$(ls dist/*.whl)
97+ uv pip install "$WHEEL_FILE"
6698 uv run python -c 'import twyn; twyn.check_dependencies()'
0 commit comments