diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..1a74362 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +# Lint and test idscope with both kinds of Qt binding, without a display. +name: tests + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + test: + name: Python ${{ matrix.python }}, ${{ matrix.qt }} + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + fail-fast: false + matrix: + include: + # imas-core, which imas-python needs, has wheels from Python 3.10 on + - python: "3.10" + qt: PyQt5 + - python: "3.12" + qt: PySide6 + env: + QT_QPA_PLATFORM: offscreen + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + cache: pip + cache-dependency-path: pyproject.toml + - name: Libraries that Qt loads + run: | + sudo apt-get update + sudo apt-get install -y libegl1 libgl1 libxkbcommon0 libfontconfig1 + - name: Install + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[test]" ${{ matrix.qt }} pyflakes + - name: pyflakes + run: python -m pyflakes src tests + - name: pytest + run: python -m pytest -q diff --git a/README.md b/README.md index 812343c..d63b770 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # idscope +[![tests](https://github.com/icyspirit/idscope/actions/workflows/tests.yml/badge.svg)](https://github.com/icyspirit/idscope/actions/workflows/tests.yml) + A lightweight [jScope](https://www.mdsplus.org/index.php/Documentation:Tutorial:GUIs:jScope)-like viewer for [IMAS](https://imas.iter.org) IDS data. It reads data with [imas-python](https://github.com/iterorganization/IMAS-Python) and draws it with @@ -357,7 +359,8 @@ QT_QPA_PLATFORM=offscreen pytest ``` The tests create synthetic data (netCDF and HDF5) and use the ITER 134173/106 training -data bundled with imas-python. +data bundled with imas-python. GitHub Actions runs them, and pyflakes, on every pull +request, with PyQt5 (Python 3.10) and with PySide6 (Python 3.12). Code layout: `idscope.data` (sources, signal paths, extraction; no Qt), `idscope.config` (YAML configuration), `idscope.templates` (YAML templates),