Repository navigation
140 lines (123 loc) · 5.22 KB
/
Copy pathtests.yml
File metadata and controls
140 lines (123 loc) · 5.22 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
# Read-only is all either job needs.
permissions:
contents: read
# Superseding pushes cancel in-flight runs instead of queueing behind them.
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint and type-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Python 3.11
uses: actions/setup-python@v7
with:
python-version: "3.11"
cache: pip
cache-dependency-path: pyproject.toml
# Install the project itself, not just the lint tools. Previously this job
# installed only `ruff mypy types-*`, so numpy/pandas/matplotlib/streamlit were
# all absent and --ignore-missing-imports collapsed them to `Any` -- mypy was
# reporting "Success" while checking almost nothing. ruff and mypy are pinned in
# the dev extra so a tool release cannot turn CI red on its own. See audit A-10.
- name: Install project and dev tooling
run: pip install -e ".[dev,formats,nist]"
- name: ruff check
run: ruff check .
- name: ruff format check
run: ruff format --check .
- name: mypy check
run: |
mypy \
eagleplot/io.py \
eagleplot/math.py \
eagleplot/plotting.py \
eagleplot/signal.py \
eagleplot/peaks.py \
eagleplot/data_tools.py \
eagleplot/annotations.py \
eagleplot/batch.py \
eagleplot/report.py \
eagleplot/plugin_loader.py \
eagleplot/spectroscopy.py \
eagleplot/nist.py \
eagleplot/cli.py \
--ignore-missing-imports --no-strict-optional --explicit-package-bases
test:
name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
# One failing cell should not hide the others -- knowing whether a break is
# version-specific or universal is most of the diagnosis.
fail-fast: false
matrix:
# pyproject declares requires-python = ">=3.9,!=3.9.7" and classifiers for
# 3.9-3.12, so every one of those is tested. Testing only 3.11 is what let
# G-010 (st.Page on 3.9) and the tomllib import in the Settings page (3.11+
# stdlib) reach users. See audit A-12.
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
include:
# Python 3.9 is pinned to ubuntu-24.04: ubuntu-latest became 26.04, and
# actions/setup-python publishes no 3.9 build for it (3.9 is past EOL), so
# the cell failed during setup before any test ran.
- os: ubuntu-24.04
python-version: "3.9"
# Non-Linux spot checks: the setup/launch scripts target macOS and Windows.
# Note macOS runners are arm64 and actions/setup-python has no 3.9 build for
# them, so the exact G-010 combination (macOS + 3.9) needs an Intel runner.
# Until then it is covered by ubuntu 3.9 plus the absolute-path assertions in
# tests/test_gui_paths.py, which are OS-independent.
# Pinned to macos-15 rather than macos-latest: -latest labels move without
# notice (macos-latest became macOS 26, and jobs on it sat queued with no
# runner on 2026-11-04). Bump deliberately when macos-15 nears retirement.
- os: macos-15
python-version: "3.12"
- os: windows-latest
python-version: "3.11"
steps:
- uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: pyproject.toml
# `[test,...]`, not `[dev,...]`: the lint tools pinned in `dev` have higher
# Python floors than this matrix spans (mypy 2.3 requires >=3.10), and the test
# job does not run them.
- name: Install project and test dependencies
run: pip install -e ".[test,formats,nist]"
# Run the whole suite. This previously enumerated 15 files by hand and so never
# ran tests/test_cli.py (27 tests, the entire CLI surface) or
# tests/test_integration.py (14 tests) -- a hand-maintained list gives no signal
# when it falls behind. See audit A-11.
# Coverage only on the cell that uploads it; the other six skip the
# instrumentation overhead.
- name: Run tests
env:
MPLBACKEND: Agg
COVERAGE_CELL: ${{ matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11' }}
shell: bash
run: |
if [ "$COVERAGE_CELL" = "true" ]; then
pytest tests/ --cov=eagleplot --cov-report=xml --cov-report=term-missing
else
pytest tests/
fi
# One cell only: with a matrix, every job uploading the same artifact name is an
# error on upload-artifact v4+.
- name: Upload coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: actions/upload-artifact@v7
with:
name: coverage-report
path: coverage.xml