Skip to content

Merge pull request #65 from ericpre/hyperspy2.0 #157

Merge pull request #65 from ericpre/hyperspy2.0

Merge pull request #65 from ericpre/hyperspy2.0 #157

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
run_test_site:
name: py${{ matrix.PYTHON_VERSION }}${{ matrix.LABEL }}
runs-on: ubuntu-latest
timeout-minutes: 30
env:
ETS_TOOLKIT: qt
PIP_ARGS: --upgrade -e
PYTEST_ARGS: --pyargs hyperspy_gui_traitsui
PYTEST_ARGS_COVERAGE:
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ['3.9', '3.10', '3.11']
PIP_SELECTOR: ['[tests]']
LABEL: [-RnMajor]
include:
# - PYTHON_VERSION: '3.8'
# PIP_SELECTOR: '[tests]'
# LABEL: -RnMinor
# - PYTHON_VERSION: '3.8'
# PIP_SELECTOR: '[tests]'
# LABEL: -Release
# - PYTHON_VERSION: '3.8'
# PIP_SELECTOR: '[tests]'
# LABEL: -RnPatch
- PYTHON_VERSION: '3.11'
PIP_SELECTOR: '[tests, coverage]'
LABEL: -RnMajor-coverage
PYTEST_ARGS_COVERAGE: --cov=. --cov-report=xml
- os: ubuntu
PYTHON_VERSION: '3.8'
OLDEST_SUPPORTED_VERSION: true
# Matching setup.py
DEPENDENCIES: traits==5.0 traitsui==6.1 pyqt5==5.12.0
PIP_SELECTOR: '[tests]'
# Hang at the end of the test suite run...
#PYTEST_ARGS_COVERAGE: --cov=. --cov-report=xml
LABEL: -RnMajor-oldest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: 'Install Ubuntu packages for Qt'
shell: bash
run: |
sudo apt-get update
sudo apt-get install qtbase5-dev
sudo apt-get install libxkbcommon-x11-0
sudo apt-get install libxcb-icccm4
sudo apt-get install libxcb-image0
sudo apt-get install libxcb-keysyms1
sudo apt-get install libxcb-randr0
sudo apt-get install libxcb-render-util0
sudo apt-get install libxcb-xinerama0
- name: Display version
run: |
python --version
pip --version
- name: Install oldest supported version
if: ${{ matrix.OLDEST_SUPPORTED_VERSION }}
run: |
pip install ${{ matrix.DEPENDENCIES }}
- name: Install HyperSpy (RELEASE_next_minor)
shell: bash
if: contains( matrix.LABEL, 'RnMinor')
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_minor.zip
- name: Install HyperSpy (RELEASE_next_major)
shell: bash
if: contains( matrix.LABEL, 'RnMajor')
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_major.zip
- name: Install HyperSpy (RELEASE_next_patch)
shell: bash
if: contains( matrix.LABEL, 'RnPatch')
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_patch.zip
- name: Install Dependencies
run: |
pip install pyqt5
- name: Install
shell: bash
run: |
pip install ${{ env.PIP_ARGS }} .'${{ matrix.PIP_SELECTOR }}'
- name: Pip list
run: |
pip list
- name: Run test suite
# run the tests headlessly
run: |
sudo apt-get install xvfb
xvfb-run pytest ${{ env.PYTEST_ARGS }} ${{ matrix.PYTEST_ARGS_COVERAGE }}
- name: Upload coverage to Codecov
if: contains( matrix.PYTEST_ARGS_COVERAGE, 'cov')
uses: codecov/codecov-action@v3