2121
2222env :
2323 PYTHON_VERSION : " 3.11"
24- POETRY_VERSION : " 1.7 .1"
24+ POETRY_VERSION : " 2.2 .1"
2525
2626jobs :
27- build :
28- if : github.ref == 'refs/heads/main'
27+ test :
2928 runs-on : ubuntu-latest
30-
31- outputs :
32- pkg-name : ${{ steps.check-version.outputs.pkg-name }}
33- version : ${{ steps.check-version.outputs.version }}
34-
3529 steps :
3630 - uses : actions/checkout@v4
3731
4337 working-directory : ${{ inputs.working-directory }}
4438 cache-key : release
4539
40+ - name : Import test dependencies
41+ run : |
42+ poetry lock
43+ poetry install --with test,test_integration
44+ working-directory : ${{ inputs.working-directory }}
45+
46+ - name : Run unit tests
47+ run : make tests
48+ working-directory : ${{ inputs.working-directory }}
49+
50+ # - name: Run integration tests
51+ # run: make integration_tests
52+ # working-directory: ${{ inputs.working-directory }}
53+
54+ - name : Get minimum versions
55+ working-directory : ${{ inputs.working-directory }}
56+ id : min-version
57+ run : |
58+ poetry run pip install packaging
59+ min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml)"
60+ echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"
61+ echo "min-versions=$min_versions"
62+
63+ - name : Run unit tests with minimum dependency versions
64+ if : ${{ steps.min-version.outputs.min-versions != '' }}
65+ env :
66+ MIN_VERSIONS : ${{ steps.min-version.outputs.min-versions }}
67+ run : |
68+ poetry run pip install $MIN_VERSIONS
69+ make tests
70+ working-directory : ${{ inputs.working-directory }}
71+
72+ build :
73+ needs : test
74+ if : github.ref == 'refs/heads/main'
75+ runs-on : ubuntu-latest
76+
77+ outputs :
78+ pkg-name : ${{ steps.check-version.outputs.pkg-name }}
79+ version : ${{ steps.check-version.outputs.version }}
80+
81+ steps :
82+ - uses : actions/checkout@v4
83+
4684 - name : Build project for distribution
4785 run : poetry build
4886 working-directory : ${{ inputs.working-directory }}
@@ -134,10 +172,6 @@ jobs:
134172
135173 poetry run python -c "import $IMPORT_NAME; print(dir($IMPORT_NAME))"
136174
137- - name : Import test dependencies
138- run : poetry install --with test,test_integration
139- working-directory : ${{ inputs.working-directory }}
140-
141175 # Overwrite the local version of the package with the test PyPI version.
142176 - name : Import published package (again)
143177 working-directory : ${{ inputs.working-directory }}
@@ -150,32 +184,6 @@ jobs:
150184 --extra-index-url https://test.pypi.org/simple/ \
151185 "$PKG_NAME==$VERSION"
152186
153- - name : Run unit tests
154- run : make tests
155- working-directory : ${{ inputs.working-directory }}
156-
157- - name : Run integration tests
158- run : make integration_tests
159- working-directory : ${{ inputs.working-directory }}
160-
161- - name : Get minimum versions
162- working-directory : ${{ inputs.working-directory }}
163- id : min-version
164- run : |
165- poetry run pip install packaging
166- min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml)"
167- echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"
168- echo "min-versions=$min_versions"
169-
170- - name : Run unit tests with minimum dependency versions
171- if : ${{ steps.min-version.outputs.min-versions != '' }}
172- env :
173- MIN_VERSIONS : ${{ steps.min-version.outputs.min-versions }}
174- run : |
175- poetry run pip install $MIN_VERSIONS
176- make tests
177- working-directory : ${{ inputs.working-directory }}
178-
179187 publish :
180188 needs :
181189 - build
0 commit comments