Use virtualenv for CI jobs
Some checks failed
CI / lint (push) Failing after 9s
CI / test (push) Failing after 7s

- Replaces system-wide installs with virtualenv for CI jobs.
- Improves dependency isolation and reproducibility.
- Sets up a virtualenv in each job.
- Activates the virtualenv before running commands.
- Installs dependencies within the virtualenv.
This commit is contained in:
Roger Gonzalez 2025-05-17 13:57:57 -03:00
parent 16837fb6fe
commit a1307e9223
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

View File

@ -7,7 +7,7 @@ on:
pull_request:
jobs:
setup:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
@ -17,9 +17,15 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Lint with ruff and mypy
- name: Set up virtualenv
run: |
uv pip install --system ruff mypy
uv venv .venv
source .venv/bin/activate
uv pip install ruff mypy
- name: Run Ruff & Mypy
run: |
source .venv/bin/activate
uv run ruff check
uv run ruff format --check
uv run mypy .
@ -34,9 +40,15 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Run tests
- name: Set up virtualenv
run: |
uv pip install --system pytest coverage
uv venv .venv
source .venv/bin/activate
uv pip install pytest coverage
- name: Run Tests
run: |
source .venv/bin/activate
uv run pytest -v --cov=. --cov-report=xml
- name: Upload to Codecov