-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 1.1 KB
/
code-quality.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
version: "0.5.x"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- 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: Check data package exports
run: uv run scripts/data_exports.py --check
- name: Run unit tests
run: uv run python -m unittest discover -v -s "./epymorph" -p "*_test.py"