Skip to content

Merge pull request #110 from ericpre/release_0.3.2 #382

Merge pull request #110 from ericpre/release_0.3.2

Merge pull request #110 from ericpre/release_0.3.2 #382

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
run_test_site:
name: ${{ matrix.os }}-py${{ matrix.PYTHON_VERSION }}${{ matrix.LABEL }}
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
env:
MPLBACKEND: agg
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
PYTHON_VERSION: ['3.10', '3.12']
LABEL: ['']
PIP_SELECTOR: ['[tests, speed]']
include:
- os: ubuntu
PYTHON_VERSION: '3.9'
PIP_SELECTOR: '[tests, speed]'
- os: ubuntu
PYTHON_VERSION: '3.11'
PIP_SELECTOR: '[tests, speed]'
- os: ubuntu
PYTHON_VERSION: '3.13'
PIP_SELECTOR: '[tests, speed]'
# test with hyperspy dev branch
- os: ubuntu
PYTHON_VERSION: '3.12'
PIP_SELECTOR: '[tests]'
LABEL: '-dev'
# test minimum requirement
- os: ubuntu
PYTHON_VERSION: '3.9'
LABEL: '-minimum'
PIP_SELECTOR: '[tests]'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: get repository name
shell: bash
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV
- name: Fetch tags upstream
if: ${{ github.repository_owner != 'hyperspy' }}
# Needs to fetch the tags from upstream to get the
# correct version with setuptools_scm
run: |
git remote add upstream https://github.com/hyperspy/${{ env.REPOSITORY_NAME }}.git
git fetch upstream --tags
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Display version
run: |
python --version
pip --version
- name: Install
run: |
pip install -e '.${{ matrix.PIP_SELECTOR }}'
- name: Install (HyperSpy dev)
# Test against the hyperspy `RELEASE_next_minor` branch
if: contains( matrix.LABEL, 'dev')
shell: bash
run: |
pip install https://github.com/hyperspy/hyperspy/archive/RELEASE_next_minor.zip
- name: Pip list
run: |
pip list
- name: Run test suite
run: |
pytest --pyargs exspy -n 2 --cov=. --cov-report=xml
- name: Upload coverage to Codecov
if: ${{ always() }}
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}