-
Notifications
You must be signed in to change notification settings - Fork 226
147 lines (126 loc) · 4.39 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 12 * * 1" # monday at noon UTC
defaults:
run:
shell: bash -l {0}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: dev-environment.yml
- name: Build packages
run: |
python -m build
cd dist
sha256sum * | tee SHA256SUMS
- name: Upload builds
uses: actions/upload-artifact@v3
with:
name: dist ${{ github.run_number }}
path: ./dist
Test:
runs-on: ${{ matrix.os }}-latest
needs: [build]
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos]
python: ['3.9', '3.12']
mpl-version: ['latest']
dist: ['ipympl*.whl']
include:
# Earliest supported Matplotlib, needs python <= 3.10
- os: ubuntu
python: '3.9'
mpl-version: '3.5'
dist: 'ipympl*.whl'
# Install from sdist not wheel
- os: ubuntu
python: '3.11'
mpl-version: 'latest'
dist: 'ipympl*.tar.gz'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: dev-environment.yml
create-args: >-
python=${{ matrix.python }}
- 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: micromamba install matplotlib=${{ matrix.mpl-version}}.*
- uses: actions/download-artifact@v3
with:
name: dist ${{ github.run_number }}
path: ./dist
- name: Install the package
run: |
cd dist
pip install -vv ${{ matrix.dist }}
- name: Test installation files
run: |
ls -l $CONDA_PREFIX/share/jupyter/nbextensions/jupyter-matplotlib
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
ls -l $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib
test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib
test -f $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/package.json
test -d $CONDA_PREFIX/share/jupyter/labextensions/jupyter-matplotlib/static
- name: Validate the labextension
run: jupyter labextension list 2>&1 | grep jupyter-matplotlib
- name: Run pytest
run: pytest -v .
- name: Install Galata test dependencies
if: matrix.os == 'ubuntu'
run: |
jlpm install
jlpm playwright install chromium
working-directory: ui-tests
- name: Run UI Tests
if: matrix.os == 'ubuntu'
run: jlpm playwright test
working-directory: ui-tests
- name: Upload UI Test artifacts
if: always() && matrix.os == 'ubuntu'
uses: actions/upload-artifact@v3
with:
name: ui-test-output
path: |
ui-tests/playwright-report
ui-tests/test-results
# If something goes wrong for the latests test cron job
# then open an issue in the repo
# This setup based on:
# https://github.com/pymmcore-plus/pymmcore-widgets/blob/5e233384e223ca00101ef4b741d3c525a5cff9c9/.github/workflows/cron.yml#L49
- name: Report Failures
if: failure() && github.event_name == 'schedule'
uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
MATPLOTLIB: ${{ matrix.mpl-version }}
RUN_ID: ${{ github.run_id }}
TITLE: '[test-bot] Scheduled Tests are failing'
with:
filename: .github/TEST_FAIL_TEMPLATE.md
update_existing: true