Skip to content

Commit

Permalink
consolidate test workflows and test latest ipywidgets
Browse files Browse the repository at this point in the history
  • Loading branch information
ianhi committed Apr 20, 2022
1 parent b4fa42d commit 8455759
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 140 deletions.
105 changes: 25 additions & 80 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,14 @@ on:
pull_request:
branches:
- main
schedule:
- cron: "0 12 * * 1" # monday at noon UTC

defaults:
run:
shell: bash -l {0}

jobs:
run:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.8]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ipympl-dev
environment-file: dev-environment.yml
python-version: ${{ matrix.python-version }}
mamba-version: "*"
auto-activate-base: false
channels: conda-forge

- name: Install ipympl
run: |
python -m build
pip install dist/*.whl
- name: Check installation files
run: |
test -d $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/extension.js
test -f $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib/index.js
test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib
test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/package.json
- name: Check nbextension and labextension
run: |
jupyter nbextension list 2>&1 | grep -ie "jupyter-matplotlib/extension.*enabled" -
jupyter labextension list 2>&1 | grep -ie "jupyter-matplotlib.*enabled.*ok" -
- name: Run tests
run: pytest .

build:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -86,7 +44,7 @@ jobs:
name: dist ${{ github.run_number }}
path: ./dist

install:
Test:
runs-on: ${{ matrix.os }}-latest
needs: [build]

Expand All @@ -95,6 +53,8 @@ jobs:
matrix:
os: [ubuntu, macos]
python: ['3.6', '3.9']
mpl-version: ['3.5', 'latest']
ipywidgets-version: ['7.7', 'latest']
include:
- python: '3.6'
dist: 'ipympl*.tar.gz'
Expand All @@ -104,7 +64,6 @@ jobs:
jlab_version: 2.3.2

steps:

- name: Checkout
uses: actions/checkout@v2

Expand All @@ -117,7 +76,23 @@ jobs:
channels: conda-forge

- name: Install dependencies
run: mamba install python=${{ matrix.python-version }} pip yarn jupyterlab=${{ matrix.jlab_version }} ipywidgets jupyter-packaging
run: mamba install python=${{ matrix.python-version }} pip yarn jupyterlab=${{ matrix.jlab_version }} jupyter-packaging nbval pytest

- if: ${{ matrix.mpl-version }} == 'latest'
name: Install latest Matplotlib
run: pip install --upgrade --pre --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple --extra-index-url https://pypi.org/simple matplotlib

- if: ${{ matrix.mpl-version }} != 'latest'
name: Install matplotlib pinned
run: mamba install matplotlib=${{ matrix.mpl-version}}.*

- if: ${{ matrix.ipywidgets-version }} == 'latest'
name: Install latest ipywidgets
run: pip install --upgrade --pre --index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple --extra-index-url https://pypi.org/simple ipywidgets

- if: ${{ matrix.ipywidgets-version }} != 'latest'
name: Install ipywidgets pinned
run: mamba install ipywidgets

- uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -150,40 +125,10 @@ jobs:
- name: Validate the labextension
run: jupyter labextension list 2>&1 | grep jupyter-matplotlib

- name: Run pytest
run: pytest .

visual-regression-tests:
runs-on: ubuntu-latest
needs: [build]

strategy:
fail-fast: false

steps:

- name: Checkout
uses: actions/checkout@v2

- name: Setup conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
mamba-version: "*"
auto-activate-base: false
channels: conda-forge

- name: Install dependencies
run: mamba install pip yarn jupyterlab=3.0.11 ipywidgets jupyter-packaging

- uses: actions/download-artifact@v2
with:
name: dist ${{ github.run_number }}
path: ./dist

- name: Install the package
run: pip install -vv ipympl*.whl
working-directory: dist

- name: Install test dependencies
- name: Install Galata test dependencies
run: yarn install
working-directory: ui-tests

Expand Down
59 changes: 0 additions & 59 deletions .github/workflows/mpl-latest.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ipympl

[![Test Status](https://github.com/matplotlib/ipympl/actions/workflows/mpl-latest.yml/badge.svg)](https://github.com/matplotlib/ipympl/actions/workflows/mpl-latest.yml?query=branch%3Amaster)
[![Test Status](https://github.com/matplotlib/ipympl/actions/workflows/main.yml/badge.svg)](https://github.com/matplotlib/ipympl/actions/workflows/main.yml?query=branch%3Amain)
[![Latest PyPI version](https://img.shields.io/pypi/v/ipympl?logo=pypi)](https://pypi.python.org/pypi/ipympl)
[![Latest conda-forge version](https://img.shields.io/conda/vn/conda-forge/ipympl?logo=conda-forge)](https://anaconda.org/conda-forge/ipympl)
[![Latest npm version](https://img.shields.io/npm/v/jupyter-matplotlib?logo=npm)](https://www.npmjs.com/package/jupyter-matplotlib)
Expand Down

0 comments on commit 8455759

Please sign in to comment.