PRISM ADRIO Data Estimation and Progress #370
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Runs formatting, linting, and unit tests on any push to main or a pull request. | |
# Useful docs: | |
# https://docs.astral.sh/uv/guides/integration/github/ | |
# https://docs.astral.sh/ruff/integrations/#github-actions | |
name: Code quality checks | |
on: | |
pull_request: | |
push: | |
branches: ['main'] | |
jobs: | |
code-quality: | |
name: Code quality checks | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: "Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: ".python-version" | |
- name: Install uv | |
run: curl -LsSf https://astral.sh/uv/0.4.5/install.sh | sh | |
- name: Cache uv and python | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.uv-cache | |
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
restore-keys: | | |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
uv-${{ runner.os }} | |
- name: Install dependencies | |
run: uv sync --frozen --all-extras --dev | |
- name: Check imports and formatting | |
run: uv run ruff check --no-fix --exclude doc/devlog --output-format=github . | |
- name: Run unit tests | |
run: uv run python -m unittest discover -v -s "./epymorph" -p "*_test.py" | |
- name: Minimize uv cache | |
run: uv cache prune --ci |