Skip to content

Commit

Permalink
CI: Add dedicated workflow for notebook testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed Oct 31, 2024
1 parent 53e9bf7 commit 81dd0f2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 20 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/basictest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,26 +172,6 @@ jobs:
python3 -c 'import NCrystal; NCrystal.test()'
. ${{github.workspace}}/install/ncrystal_unsetup.sh
- name: Checkout ncrystal-notebooks
if: matrix.python != '3.7' && matrix.python != '3.8'
uses: actions/checkout@v4
with:
repository: mctools/ncrystal-notebooks
path: src_notebooks

- name: Extra pip install for notebooks
if: matrix.python != '3.7' && matrix.python != '3.8'
run: |
set -eu
python3 -m pip install numpy matplotlib spglib ase gemmi jupyterlab ipympl
- name: Test notebooks
if: matrix.python != '3.7' && matrix.python != '3.8'
run: |
set -eu
eval $(${{github.workspace}}/install/bin/ncrystal-config --setup)
./src_notebooks/.github/resources/run_notebooks.x
#Final step, so tmate step can check if we got this far.
- name: Final
id: final-step
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/test_notebooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: notebooks

on:
push:
pull_request:
schedule:
- cron: '30 21 * * 0' # 21:30 every Sunday

jobs:
build:
strategy:
matrix:
include:
#Note: Python 3.13 works (Aug 2024) because of the
#"allow-prereleases: true" below.
- { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.9' }
- { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.13' }
- { os: macos-latest, CC: clang, CXX: clang++, python: "3.12" }
name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }}
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src_ncrystal

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true #Needed (Aug 2024) for Python 3.13.

- name: Pip install ncrystal
shell: cmd
run: python3 -m pip install ./src_ncrystal/

- name: Checkout ncrystal-notebooks
uses: actions/checkout@v4
with:
repository: mctools/ncrystal-notebooks
path: src_notebooks

- name: Extra pip install for notebooks
run: python3 -m pip install numpy matplotlib spglib ase gemmi jupyterlab ipympl

- name: Test notebooks
run: ./src_notebooks/.github/resources/run_notebooks.x

0 comments on commit 81dd0f2

Please sign in to comment.