Skip to content

Commit 64f5c50

Browse files
dobyclaude
andcommitted
ci: ajoute GitHub Actions pour la suite pytest
- .github/workflows/tests.yml : matrice Ubuntu × Python 3.11/3.12/3.13 plus un run macOS 3.12 (plateforme cible des bundles .app). Lance pytest --cov sur push/PR vers main + déclenchement manuel. - README{.md,.fr.md} : badge live de l'action remplace le compteur statique « 25 passing » devenu obsolète (30 tests aujourd'hui). - CLAUDE.md : section Conventions mentionne le workflow. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 28fae2e commit 64f5c50

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
workflow_dispatch:
9+
10+
jobs:
11+
pytest:
12+
name: pytest (${{ matrix.os }}, py${{ matrix.python-version }})
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
# Ubuntu sur toute la matrice ; un seul run macOS pour confirmer
18+
# que le code marche sur la plateforme cible des bundles .app.
19+
os: [ubuntu-latest]
20+
python-version: ['3.11', '3.12', '3.13']
21+
include:
22+
- os: macos-latest
23+
python-version: '3.12'
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Setup Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
cache: pip
33+
cache-dependency-path: pyproject.toml
34+
35+
- name: Install package + dev extras
36+
run: |
37+
python -m pip install --upgrade pip
38+
pip install -e ".[dev]"
39+
40+
- name: Run pytest with coverage
41+
run: pytest --cov --cov-report=term-missing

CLAUDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ ne pas les défaire sans raison.
136136
PyInstaller pour le bundle macOS (extra `[build]`).
137137
- Tests Python 3.11+ (`requires-python = ">=3.11"`), sockets mockés intégralement —
138138
jamais besoin d'une caméra réelle pour `pytest`.
139+
- CI : `.github/workflows/tests.yml` lance `pytest --cov` sur Ubuntu × {3.11, 3.12,
140+
3.13} + un run macOS 3.12. Aucun secret requis, aucune dépendance externe — les
141+
tests sont 100 % stdlib + `pytest`/`pytest-cov` (extra `[dev]`).
139142
- Tailles d'octets : `format_size` (base 1024, pour la taille des fichiers)
140143
vs `format_storage_size` (base 1000 SI, pour l'affichage carte mémoire — colle
141144
à l'étiquette « 32 Go » du fabricant). Ne pas mélanger.

README.fr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ordinateur) via PTP/IP. Pas de câble USB, pas d'app propriétaire (Nikon WMU es
77
abandonnée et cassée sur les macOS récents), pas de `libgphoto2`. Le cœur est
88
en **Python stdlib pur** ; la GUI optionnelle ajoute PySide6 + Pillow.
99

10-
[![tests](https://img.shields.io/badge/tests-25%20passing-brightgreen)]()
10+
[![tests](https://github.com/doby/nikon-transfer-wifi-dseries/actions/workflows/tests.yml/badge.svg)](https://github.com/doby/nikon-transfer-wifi-dseries/actions/workflows/tests.yml)
1111
[![python](https://img.shields.io/badge/python-3.11%2B-blue)]()
1212
[![license](https://img.shields.io/badge/license-MIT-lightgrey)]()
1313

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PTP/IP protocol. No USB cable, no proprietary app (Nikon WMU is abandoned and br
77
on recent macOS), no `libgphoto2`. The core is **pure Python stdlib**; the optional
88
GUI adds PySide6 + Pillow.
99

10-
[![tests](https://img.shields.io/badge/tests-25%20passing-brightgreen)]()
10+
[![tests](https://github.com/doby/nikon-transfer-wifi-dseries/actions/workflows/tests.yml/badge.svg)](https://github.com/doby/nikon-transfer-wifi-dseries/actions/workflows/tests.yml)
1111
[![python](https://img.shields.io/badge/python-3.11%2B-blue)]()
1212
[![license](https://img.shields.io/badge/license-MIT-lightgrey)]()
1313

0 commit comments

Comments
 (0)