-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (59 loc) · 2.44 KB
/
Copy pathtestexamples.yml
File metadata and controls
65 lines (59 loc) · 2.44 KB
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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test examples
on:
pull_request:
schedule:
# Use odd number of minutes, because GitHub says the start of the hour is a
# high-load time.
- cron: '17 0 * * 0'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
if: always()
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.x]
xbout-version: ['release', 'master']
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libhdf5-dev libnetcdf-dev
python -m pip install --upgrade pip
pip install --upgrade jupyter ipympl
- name: Install xbout release
if: ${{matrix.xbout-version == 'release'}}
run: |
pip install --upgrade xbout
- name: Install xbout master
if: ${{matrix.xbout-version == 'master'}}
run: |
pip install 'xbout @ git+https://github.com/boutproject/xBOUT@master'
- name: Install mayavi
# Skip for Python-3.11 because Mayavi currently fails to build
if: ${{ matrix.python-version != '3.x' }}
run: |
sudo apt-get install xvfb
pip install --upgrade mayavi wand PyQt5
- name: Test mayavi scripts
# Skip for Python-3.11 because Mayavi currently fails to build
if: ${{ matrix.python-version != '3.x' }}
run: |
# The brackets are needed so the whole command returns 1 if any script fails.
# Note, the tests of python scripts must come first, because the
# jupyter notebook tests work by converting the notebook to a Python
# script, and we don't want to test those scripts as they will fail due
# to iPython stuff not being imported.
(for example in elm-pb/3d-movie.py; do ETS_TOOLKIT=null xvfb-run --server-args="-screen 0 1024x768x24" python $example --ci || exit 1; done)
- name: Test Jupyter notebooks
run: |
# The brackets are needed so the whole command returns 1 if any notebook fails.
(for example in */*.ipynb; do jupyter nbconvert --to python --execute $example || exit 1; done)