Skip to content

Integration tests

Integration tests #861

Workflow file for this run

name: Integration tests
on:
workflow_dispatch:
schedule:
- cron: '10 0 * * *'
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
integration_test:
name: py${{ matrix.PYTHON_VERSION }}-hs_${{ matrix.HYPERSPY_VERSION }}-ext_${{ matrix.EXTENSION_VERSION }}${{ matrix.LABEL }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
HYPERSPY_VERSION: ['release', 'RnP', 'RnM']
EXTENSION_VERSION: ['release', 'dev']
DEPENDENCIES_DEV: [false]
DEPENDENCIES_PRE_RELEASE: [false]
DEPENDENCIES_NUMBA_DEV: [false]
USE_MAMBA: [true]
PYTHON_VERSION: ['3.10']
include:
# test against upstream dev
- DEPENDENCIES_DEV: true
# Install dev version from https://pypi.anaconda.org/scipy-wheels-nightly/simple
# using pip
LABEL: -dependencies_dev
HYPERSPY_VERSION: 'RnM'
EXTENSION_VERSION: 'dev'
DEPENDENCIES: matplotlib scipy scikit-learn
USE_MAMBA: false
PYTHON_VERSION: '3.10'
- DEPENDENCIES_PRE_RELEASE: true
# Install RC version available on pypi
LABEL: -dependencies_pre_release
HYPERSPY_VERSION: 'RnM'
EXTENSION_VERSION: 'dev'
DEPENDENCIES: matplotlib scipy scikit-learn sympy h5py scikit-image numba
USE_MAMBA: false
PYTHON_VERSION: '3.11'
- DEPENDENCIES_NUMBA_DEV: true
# Install dev version from numba/label/dev channel using mamba
LABEL: -dependencies_numba_dev
HYPERSPY_VERSION: 'RnM'
EXTENSION_VERSION: 'dev'
DEPENDENCIES: numba
USE_MAMBA: true
PYTHON_VERSION: '3.11'
env:
MPLBACKEND: agg
EXTENSION: kikuchipy lumispy pyxem
TEST_DEPS: pytest pytest-xdist pytest-rerunfailures pytest-mpl
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@main
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: ${{ matrix.PYTHON_VERSION }}
# use base environment, so that when using pip, this is from the
# mambaforge distribution
# auto-activate-base: true
activate-environment: "test"
- name: Install pip
run: |
mamba install pip
- name: Conda info
run: |
conda info
conda list
- name: Install numba development version
if: ${{ matrix.DEPENDENCIES_NUMBA_DEV }}
run: |
# Install numba dev version
mamba install -c numba/label/dev ${{ matrix.DEPENDENCIES }}
- name: Install dependencies development version
if: ${{ matrix.DEPENDENCIES_DEV }}
run: |
pip install --upgrade --pre --extra-index-url \
https://pypi.anaconda.org/scipy-wheels-nightly/simple \
${{ matrix.DEPENDENCIES }}
pip install https://github.com/scikit-image/scikit-image/archive/main.zip
- name: Install dependencies pre release version
if: ${{ matrix.DEPENDENCIES_PRE_RELEASE }}
run: |
pip install --upgrade --pre ${{ matrix.DEPENDENCIES }}
- name: Install Test dependencies
run: |
pip install ${{ env.TEST_DEPS }}
- name: Conda list
run: |
conda list
- name: Install HyperSpy release
if: contains(matrix.HYPERSPY_VERSION, 'release')
run: |
mamba install hyperspy-base
- name: Install HyperSpy RnP
if: contains(matrix.HYPERSPY_VERSION, 'RnP')
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_patch.zip
- name: Install HyperSpy RnM
if: contains(matrix.HYPERSPY_VERSION, 'RnM')
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_minor.zip
- name: Install Extension Release
if: contains(matrix.EXTENSION_VERSION, 'release')
run: |
mamba install ${{ env.EXTENSION }}
- name: Install Extension Dev
if: contains(matrix.EXTENSION_VERSION, 'dev')
run: |
pip install https://github.com/lumispy/lumispy/archive/main.zip
pip install https://github.com/pyxem/kikuchipy/archive/develop.zip
pip install https://github.com/pyxem/pyxem/archive/main.zip
- name: Clear conda and pip cache
run: |
conda clean --all
pip cache purge
- name: Conda list
run: |
conda list
- name: Run HyperSpy Test Suite
run: |
python -m pytest --pyargs hyperspy --reruns 3 -n 2
- name: Run kikuchipy Test Suite
if: ${{ always() }}
run: |
# Virtual buffer (xvfb) required for tests using PyVista
sudo apt-get install xvfb
xvfb-run python -m pytest --pyargs kikuchipy
- name: Run LumiSpy Test Suite
if: ${{ always() }}
#if: contains(matrix.EXTENSION_VERSION, 'dev') # Tests only against development version, if a fix is not released yet.
run: |
python -m pytest --pyargs lumispy
- name: Run Pyxem Test Suite
if: ${{ always() }}
run: |
python -m pytest --pyargs pyxem