Skip to content

Commit

Permalink
use setup-cached-uv in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jab committed Aug 25, 2024
1 parent 4b285a0 commit 1ee255a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,25 @@ jobs:
python-version: ${{ matrix.pyversion }}
cache: pip
cache-dependency-path: dev-deps/test.txt
- name: install dependencies
- name: set up cached uv
uses: hynek/setup-cached-uv@4b4bfa932036976749a9653b0fa4fa10b1a7092b
- name: uv pip install
run: uv venv && uv pip install -r dev-deps/test.txt
- name: activate virtualenv
run: |
python -m pip install -U uv
python -m uv pip install -r dev-deps/test.txt
source .venv/bin/activate
echo PATH="$PATH" >> "$GITHUB_ENV"
- name: cache .mypy_cache dir
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: .mypy_cache
key: mypy
- name: run mypy
run: python -m mypy bidict tests
run: mypy bidict tests
- name: set hypothesis profile
run: |
hypothesis_profile=${{ github.event.inputs.hypothesis_profile || (github.event_name == 'schedule' && 'more-examples' || 'default') }}
echo PYTEST_ADDOPTS="${PYTEST_ADDOPTS} --hypothesis-profile=$hypothesis_profile" >> "${GITHUB_ENV}"
echo PYTEST_ADDOPTS="$PYTEST_ADDOPTS --hypothesis-profile=$hypothesis_profile" >> "$GITHUB_ENV"
- name: cache .hypothesis dir
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
Expand All @@ -76,12 +80,12 @@ jobs:
- name: maybe enable coverage
if: matrix.enable_coverage
run: |
echo COVERAGE_PROCESS_START="$(pwd)/.coveragerc" >> "${GITHUB_ENV}"
echo RUN_PYTEST_CMD="coverage run" >> "${GITHUB_ENV}"
echo COVERAGE_PROCESS_START="$(pwd)/.coveragerc" >> "$GITHUB_ENV"
echo RUN_PYTEST_CMD="coverage run" >> "$GITHUB_ENV"
- name: set COVERAGE_CORE=sysmon if py3.12
if: matrix.pyversion == '3.12'
run: |
echo COVERAGE_CORE=sysmon >> "${GITHUB_ENV}"
echo COVERAGE_CORE=sysmon >> "$GITHUB_ENV"
- name: run pytest
run: ${RUN_PYTEST_CMD:-python} -m pytest
- name: combine and show any collected coverage
Expand Down

0 comments on commit 1ee255a

Please sign in to comment.