From ee4f9e18fd1b2615641c5fe93bba94915e7d95ad Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 8 Oct 2024 04:12:32 +0100 Subject: [PATCH] Use environment variables to remove duplication in uv commands --- .github/workflows/ci.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 039859a..5ee47d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,15 +28,19 @@ jobs: - name: "Lint" run: | - uv run --all-extras --python=${{ matrix.python-version }} pre-commit run --all-files --hook-stage pre-commit --verbose - uv run --all-extras --python=${{ matrix.python-version }} pre-commit run --all-files --hook-stage pre-push --verbose - uv run --all-extras --python=${{ matrix.python-version }} pre-commit run --all-files --hook-stage manual --verbose + uv run --extra=dev pre-commit run --all-files --hook-stage pre-commit --verbose + uv run --extra=dev pre-commit run --all-files --hook-stage pre-push --verbose + uv run --extra=dev pre-commit run --all-files --hook-stage manual --verbose + env: + UV_PYTHON: ${{ matrix.python-version }} - name: "Run tests" run: | # We run tests against "." and not the tests directory as we test the README # and documentation. - uv run --all-extras --python=${{ matrix.python-version }} pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml + uv run --extra=dev pytest -s -vvv --cov-fail-under 100 --cov=src/ --cov=tests . --cov-report=xml + env: + UV_PYTHON: ${{ matrix.python-version }} - name: "Upload coverage to Codecov" uses: "codecov/codecov-action@v4"