@@ -129,7 +129,7 @@ jobs:
129129 !contains(needs.*.result, 'failure') &&
130130 !contains(needs.*.result, 'cancelled') &&
131131 needs.files-changed.outputs.documentation == 'true'
132- needs : ["files-changed", "yaml-lint", "python-lint"]
132+ needs : ["prepare-environment", " files-changed", "yaml-lint", "python-lint"]
133133 runs-on : " ubuntu-22.04"
134134 timeout-minutes : 5
135135 steps :
@@ -145,10 +145,18 @@ jobs:
145145 cache-dependency-path : docs/package-lock.json
146146 - name : " Install dependencies"
147147 run : npm install
148- - name : " Setup Python environment"
149- run : " pip install invoke"
148+ - name : Set up Python
149+ uses : actions/setup-python@v6
150+ with :
151+ python-version : " 3.12"
152+ - name : Install UV
153+ uses : astral-sh/setup-uv@v4
154+ with :
155+ version : " ${{ needs.prepare-environment.outputs.UV_VERSION }}"
156+ - name : Install dependencies
157+ run : uv sync --all-groups --all-extras
150158 - name : " Build docs website"
151- run : " invoke docs"
159+ run : " uv run invoke docs"
152160
153161 validate-generated-documentation :
154162 if : |
@@ -168,17 +176,14 @@ jobs:
168176 uses : actions/setup-python@v6
169177 with :
170178 python-version : " 3.12"
171- - name : " Setup Python environment"
172- run : |
173- pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
174- poetry config virtualenvs.create true --local
175- poetry env use 3.12
176- - name : " Install dependencies"
177- run : " poetry install --no-interaction --no-ansi --extras ctl"
178- - name : " Setup environment"
179- run : " poetry run pip install invoke"
180- - name : " Validate generated documentation"
181- run : " poetry run invoke docs-validate"
179+ - name : Install UV
180+ uses : astral-sh/setup-uv@v4
181+ with :
182+ version : " ${{ needs.prepare-environment.outputs.UV_VERSION }}"
183+ - name : Install dependencies
184+ run : uv sync --all-groups --all-extras
185+ - name : Validate generated documentation
186+ run : uv run invoke docs-validate
182187
183188 validate-documentation-style :
184189 if : |
@@ -232,24 +237,19 @@ jobs:
232237 uses : actions/setup-python@v6
233238 with :
234239 python-version : ${{ matrix.python-version }}
235- - name : " Setup environment"
236- run : |
237- pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }} --python python${{ matrix.python-version }}
238- poetry config virtualenvs.create true --local
239- pip install invoke codecov
240- - name : " Install tomli for Python < 3.11"
241- if : matrix.python-version == '3.9' || matrix.python-version == '3.10'
242- run : |
243- pip install tomli
244- - name : " Install Package"
245- run : " poetry install --all-extras"
246- - name : " Mypy Tests"
247- run : " poetry run mypy --show-error-codes infrahub_sdk/"
248- - name : " Unit Tests"
249- run : " poetry run pytest --cov infrahub_sdk tests/unit/"
240+ - name : Install UV
241+ uses : astral-sh/setup-uv@v4
242+ with :
243+ version : " ${{ needs.prepare-environment.outputs.UV_VERSION }}"
244+ - name : Install dependencies
245+ run : uv sync --all-groups --all-extras
246+ - name : Mypy Tests
247+ run : uv run mypy --show-error-codes infrahub_sdk/
248+ - name : Unit Tests
249+ run : uv run pytest --cov infrahub_sdk tests/unit/
250250 - name : " Upload coverage to Codecov"
251251 run : |
252- codecov --flags python-${{ matrix.python-version }}
252+ uv run codecov --flags python-${{ matrix.python-version }}
253253 env :
254254 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
255255
@@ -259,11 +259,10 @@ jobs:
259259 - name : " Report coverage for pytest-plugin"
260260 if : matrix.python-version == '3.12'
261261 run : |
262- source $(poetry env info --path)/bin/activate
263- coverage run --source=infrahub_sdk -m pytest tests/unit/pytest_plugin
264- coverage report -m
265- coverage xml
266- codecov --flags python-filler-${{ matrix.python-version }}
262+ uv run coverage run --source=infrahub_sdk -m pytest tests/unit/pytest_plugin
263+ uv run coverage report -m
264+ uv run coverage xml
265+ uv run codecov --flags python-filler-${{ matrix.python-version }}
267266 env :
268267 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
269268
@@ -289,19 +288,17 @@ jobs:
289288 run : |
290289 RUNNER_NAME=$(echo "${{ runner.name }}" | grep -o 'ghrunner[0-9]\+' | sed 's/ghrunner\([0-9]\+\)/ghrunner_\1/')
291290 echo "PYTEST_DEBUG_TEMPROOT=/var/lib/github/${RUNNER_NAME}/_temp" >> $GITHUB_ENV
292- - name : " Setup environment"
293- run : |
294- pipx install poetry==${{ needs.prepare-environment.outputs.POETRY_VERSION }}
295- poetry config virtualenvs.create true --local
296- pip install invoke codecov
297- - name : " Install Package"
298- run : " poetry install --all-extras"
299- - name : " Integration Tests"
300- run : |
301- poetry run pytest --cov infrahub_sdk tests/integration/
291+ - name : Install UV
292+ uses : astral-sh/setup-uv@v4
293+ with :
294+ version : " ${{ needs.prepare-environment.outputs.UV_VERSION }}"
295+ - name : Install dependencies
296+ run : uv sync --all-groups --all-extras
297+ - name : Integration Tests
298+ run : uv run pytest --cov infrahub_sdk tests/integration/
302299 - name : " Upload coverage to Codecov"
303300 run : |
304- codecov --flags integration-tests
301+ uv run codecov --flags integration-tests
305302 env :
306303 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
307304
0 commit comments