-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (62 loc) · 1.89 KB
/
tests.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel concurent in-progress jobs or run on pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
ruff-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
with:
args: "check --output-format concise"
ruff-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/ruff-action@v1
with:
args: "format --diff"
mypy:
name: Mypy ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyton-version }}
- name: Run mypy
# Installing mypy here to bypass uv lockfile and run with a higher version
run: uv run --no-dev --group mypy --with mypy -- mypy
tests:
name: Tests Maya ${{ matrix.maya-version }}
strategy:
matrix:
maya-version: ["2025", "2024", "2023", "2022"]
runs-on: ubuntu-latest
container:
image: tahv/mayapy:${{ matrix.maya-version }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v4
- name: Sync environment
run: uv sync --no-dev --group test --group cov
- run: echo "PYTHONPATH=$(find .venv/lib/python*/site-packages -maxdepth 0):src" >> $GITHUB_ENV
- name: Run tests
run: uv run --no-sync -- mayapy -m coverage run -p -m pytest -vvv
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-data-${{ matrix.maya-version }}
path: .coverage.*
if-no-files-found: ignore