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 20, 2024
1 parent ac9fdd1 commit b13ac39
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/build_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,24 @@ 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
rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.0.1.dist-info
rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.3.1.dist-info
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 "mesa @ ."
- name: Test with pytest
run: pytest --durations=10 --cov=mesa tests/ --cov-report=xml
- if: matrix.os == 'ubuntu'
Expand All @@ -90,18 +96,24 @@ 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
rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.0.1.dist-info
rm -fr ${Python_ROOT_DIR}/lib/python${{ matrix.python-version}}/site-packages/pip-23.3.1.dist-info
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 "mesa @ ."
- name: Checkout mesa-examples
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit b13ac39

Please sign in to comment.