Repository navigation
94 lines (90 loc) · 3.79 KB
/
Copy pathci.yml
File metadata and controls
94 lines (90 loc) · 3.79 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
inputs:
parity:
description: "Record MATLAB golden calls (static2d) and replay them"
type: boolean
default: false
jobs:
test:
name: Lint and unit tests (no MATLAB)
runs-on: ubuntu-latest
# In the official Python image (Debian 13, as the Dockerfile), not on the runner itself: since
# 2026-11-09 apt-get fails on the GitHub runners (Ubuntu 26.04 cannot resolve the Ubuntu
# package servers; Ubuntu 24.04 fails at the same step), while Debian's servers work.
container: python:${{ matrix.python-version }}-slim-trixie
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.12"]
steps:
# System libraries of Qt and Mesa's OpenGL (napari, dialogs) and a virtual display, as in
# the Dockerfile.
- name: Qt system libraries
run: |
apt-get update -q
apt-get install -y -q --no-install-recommends \
git xvfb xauth libgl1 libegl1 libegl-mesa0 libopengl0 libglx-mesa0 libgl1-mesa-dri \
libglib2.0-0t64 libfontconfig1 libfreetype6 libdbus-1-3 \
libx11-6 libx11-xcb1 libxext6 libxrender1 libxi6 libxkbcommon0 libxkbcommon-x11-0 \
libxcb1 libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 \
libxcb-render-util0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-xfixes0 \
libxcb-xinerama0 libxcb-xinput0 libxcb-xkb1
- uses: actions/checkout@v5
- run: pip install -e ".[dev]" scikit-image h5py
- run: ruff check src tests examples tools demo
- run: xvfb-run -a pytest tests/unit -q
test-macos-windows:
name: Unit tests (${{ matrix.os }}, pip install as in the README)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.12"
# pytest-github-actions-annotate-failures: each failing test becomes an annotation of the run
# (its message is readable on the run page and through the API, unlike the log)
- run: pip install -e ".[dev,io]" scikit-image pytest-github-actions-annotate-failures
# The napari viewer tests need OpenGL, which these runners do not offer to napari (Windows:
# GLError on the canvas; macOS: crash): skipped here, run by the Linux job. Two worker
# processes (-n 2): a test that crashes Python is reported as that test's failure.
- run: pytest tests/unit -q -rfE --tb=short -n 2
env:
MONALISA_TESTS_NO_OPENGL: "1"
parity:
name: MATLAB parity (static2d)
if: github.event_name == 'workflow_dispatch' && inputs.parity
runs-on: ubuntu-latest
env:
UPSTREAM_COMMIT: 0cb5cf93c699870bcd93a00b2e2cd787bef73fcc
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v5
with:
repository: MattechLab/monalisa
ref: ${{ env.UPSTREAM_COMMIT }}
path: upstream
- uses: matlab-actions/setup-matlab@v2
with:
products: Image_Processing_Toolbox Statistics_and_Machine_Learning_Toolbox
- name: Compile upstream MEX files
uses: matlab-actions/run-command@v2
with:
command: addpath(genpath('upstream/src')); compile_mex_for_monalisa
- name: Record golden calls
uses: matlab-actions/run-command@v2
with:
command: addpath('tools/matlab_capture'); run_capture('static2d', fullfile(pwd,'fixtures','matlab'), fullfile(pwd,'upstream'), 'maxBytes', 20e6)
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- run: pip install -e ".[dev]" scikit-image h5py
- run: pytest tests/parity -q -n auto