Skip to content

Commit

Permalink
ci: Use uv pip for faster build
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Feb 16, 2024
1 parent 9d4f6e1 commit b07818d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/build_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,22 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
# Workaround; remove once https://github.com/astral-sh/uv/issues/1386 is fixed
- run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
- name: Install uv
run: pip install uv
- name: Install dependencies
# Only if the cache misses
# Based on https://github.com/pypa/pip/issues/8049#issuecomment-633845028
# read_requirements.py should be removed once
# https://github.com/pypa/pip/issues/11440 is resolved.
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install toml
uv pip install toml
python tests/read_requirements.py > requirements.txt
pip install -r requirements.txt
uv pip install -r requirements.txt
- name: Install Mesa
run: pip install --no-deps .
run: uv pip install --no-deps .
- name: Test with pytest
run: pytest --cov=mesa tests/ --cov-report=xml
- if: matrix.os == 'ubuntu'
Expand All @@ -90,18 +94,22 @@ jobs:
with:
path: ${{ env.pythonLocation }}
key: test-examples-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}
# Workaround; remove once https://github.com/astral-sh/uv/issues/1386 is fixed
- run: echo "VIRTUAL_ENV=${Python_ROOT_DIR}" >> $GITHUB_ENV
- name: Install uv
run: pip install uv
- name: Install dependencies
# Only if the cache misses
# Based on https://github.com/pypa/pip/issues/8049#issuecomment-633845028
# read_requirements.py should be removed once
# https://github.com/pypa/pip/issues/11440 is resolved.
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install toml
uv pip install toml
python tests/read_requirements.py > requirements.txt
pip install -r requirements.txt
uv pip install -r requirements.txt
- name: Install Mesa
run: pip install --no-deps .
run: uv pip install --no-deps .
- name: Checkout mesa-examples
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit b07818d

Please sign in to comment.