Merge remote-tracking branch 'origin/hyperspy2.0' #158
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
- 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 | |
- PYTHON_VERSION: '3.8' | |
PIP_ARGS: --pre --upgrade | |
LABEL: -mininum-RnMajor | |
PIP_SELECTOR: '[tests]' | |
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 git+https://github.com/hyperspy/hyperspy.git@/RELEASE_next_minor | |
- name: Install HyperSpy (RELEASE_next_major) | |
shell: bash | |
if: contains( matrix.LABEL, 'RnMajor') | |
run: | | |
pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_major | |
- name: Install HyperSpy (RELEASE_next_patch) | |
shell: bash | |
if: contains( matrix.LABEL, 'RnPatch') | |
run: | | |
pip install git+https://github.com/hyperspy/hyperspy.git@/RELEASE_next_patch | |
- name: Install exSpy | |
if: "!contains( matrix.LABEL, 'mininum')" | |
shell: bash | |
run: | | |
pip install git+https://github.com/hyperspy/exspy.git | |
- 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 |