-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (45 loc) · 1.58 KB
/
tests.yml
File metadata and controls
47 lines (45 loc) · 1.58 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
name: Run tests and upload coverage
on:
release:
types: [created]
jobs:
test:
name: Run tests and collect coverage
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-14]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install .
- name: Format Python code with black
run: |
black --check --diff .
- name: Lint Cython code
run: |
cython-lint src/edsger/commons.pyx src/edsger/dijkstra.pyx src/edsger/path_tracking.pyx src/edsger/pq_4ary_dec_0b.pyx src/edsger/spiess_florian.pyx src/edsger/star.pyx src/edsger/commons.pxd src/edsger/pq_4ary_dec_0b.pxd
- name: Run tests with coverage
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10'
run: |
pytest --cov=src/edsger --cov-branch --cov-report=xml tests/
- name: Run tests without coverage
if: matrix.os != 'ubuntu-22.04' || matrix.python-version != '3.10'
run: |
pytest tests/
- name: Upload results to Codecov
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10'
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}