Skip to content

Tests

Tests #154

Workflow file for this run

name: Tests
on:
push:
branches-ignore:
- 'dependabot/*'
pull_request:
branches:
- '*'
schedule:
# Run at midnight on each Saturday
- cron: '0 0 * * 6'
workflow_dispatch:
jobs:
run_test_site:
name: ${{ matrix.os }}-${{ matrix.PACKAGE_MANAGER }}-py${{ matrix.PYTHON_VERSION }}${{ matrix.LABEL }}
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 30
env:
PIP_ARGS: '-e .'
PIP_SELECTOR: ''
MPLBACKEND: agg
PYTEST_ARGS: --pyargs start_jupyter_cm
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "macos", "windows"]
PYTHON_VERSION: ['3.9', '3.10', '3.12']
PACKAGE_MANAGER: [conda, pip]
# Use only in conda based distribution
ENVIRONMENT_NAME: ["test_env"]
TEST_DEPS: ["qtconsole jupyterlab pytest"]
include:
# The python version of the base environment will be what comes with
# the distribution
- os: ubuntu
ENVIRONMENT_NAME: ''
PACKAGE_MANAGER: conda
TEST_DEPS: 'qtconsole jupyterlab pytest'
LABEL: _base_env
- os: ubuntu
PYTHON_VERSION: '3.13-dev'
PACKAGE_MANAGER: pip
TEST_DEPS: 'qtconsole pytest'
- os: ubuntu
ENVIRONMENT_NAME: 'test_env'
PYTHON_VERSION: '3.11'
PACKAGE_MANAGER: conda
TEST_DEPS: 'qtconsole jupyterlab pytest'
steps:
- uses: actions/checkout@v4
- name: Install file manager
if: runner.os == 'linux'
run: |
sudo apt-get update -y
sudo apt-get install -y nautilus dolphin caja libglib2.0-bin nemo
- uses: conda-incubator/setup-miniconda@v3
if: ${{ matrix.PACKAGE_MANAGER == 'conda' }}
with:
miniforge-version: latest
auto-activate-base: true
activate-environment: ${{ matrix.ENVIRONMENT_NAME }}
python-version: ${{ matrix.PYTHON_VERSION }}
conda-remove-defaults: "true"
- name: Install pip (conda)
if: ${{ matrix.PACKAGE_MANAGER == 'conda' }}
run: |
conda install pip
- uses: actions/setup-python@v5
if: ${{ matrix.PACKAGE_MANAGER == 'pip' }}
name: Install Python
with:
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Display version
run: |
python --version
pip --version
- name: Install
run: |
pip install ${{ env.PIP_ARGS }}
- name: Install test dependencies (pip)
if: ${{ matrix.PACKAGE_MANAGER == 'pip' }}
run: |
pip install ${{ matrix.TEST_DEPS }}
- name: Install test dependencies (conda)
if: ${{ matrix.PACKAGE_MANAGER == 'conda' }}
run: |
conda install ${{ matrix.TEST_DEPS }}
- name: Conda info
if: ${{ matrix.PACKAGE_MANAGER == 'conda' }}
run: |
conda info
- name: Conda list
if: ${{ matrix.PACKAGE_MANAGER == 'conda' }}
run: |
conda list
- name: Pip list
if: ${{ matrix.PACKAGE_MANAGER == 'pip' }}
run: |
pip list
- name: Run test suite
run: |
pytest ${{ env.PYTEST_ARGS }}
- name: Test command
run: |
start_jupyter_cm
start_jupyter_cm --remove