-
Notifications
You must be signed in to change notification settings - Fork 20
56 lines (53 loc) · 1.7 KB
/
Copy pathci.yml
File metadata and controls
56 lines (53 loc) · 1.7 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Install dependencies
run: pip install -e ".[lint]"
- name: Ruff
run: ruff check petbox/dca tests docs
# Three separate mypy invocations, not one over all three trees: `petbox/` is a namespace
# package with no __init__.py, so `mypy petbox/dca tests docs` makes mypy resolve
# petbox/dca/__init__.py as both `dca` and `petbox.dca` and abort with "Source file found
# twice under different module names".
#
# --strict is pinned explicitly even though pyproject.toml sets `strict = true`, so that a
# flag dropped from the config fails here rather than silently widening what CI accepts.
- name: Mypy (strict, package, tests and docs)
run: |
mypy --strict petbox/dca
mypy --strict tests
mypy --strict docs
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[test]"
- name: Run tests
run: pytest
- name: Upload coverage to Coveralls
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: coverallsapp/github-action@v2
continue-on-error: true
with:
file: coverage.lcov
format: lcov