ukaea / paramak

Create parametric 3D fusion reactor CAD models
https://paramak.readthedocs.io/en/main/
37 stars 12 forks source link

Look into alternative ways of running the notebook examples as tests #832

Open shimwell opened 3 years ago

shimwell commented 3 years ago

Remi makes use of a different menthod of running the test notebooks.

Compare this to what we have and see if we can upgrade the method used

# This is a basic workflow to help you get started with Actions

name: Test demos

# Controls when the action will run. 
on:
  # Triggers the workflow on push or pull request events but only for the master branch
  push:
    branches:
    - master
    - dev
  pull_request:
    branches:
    - master
    - dev

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    container: quay.io/fenicsproject/stable:latest
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      # Runs a single command using the runners shell
      - name: Run the notebooks
        run: |
          jupyter-nbconvert --to python demos/demo_multi_materials.ipynb
          mkdir outputs
          python3 -m demos.demo_multi_materials
          jupyter-nbconvert --to python demos/demo_meshes.ipynb
          python3 -m demos.demo_meshes
          jupyter-nbconvert --to python demos/demo_derived_quantities.ipynb
          python3 -m demos.demo_derived_quantities
          jupyter-nbconvert --to python demos/demo_Ogorodnikova.ipynb
          python3 -m demos.demo_Ogorodnikova
          jupyter-nbconvert --to python demos/demo_coupled_heat_transfer.ipynb
          python3 -m demos.demo_coupled_heat_transfer

Originally posted by @RemDelaporteMathurin in https://github.com/ukaea/paramak/issues/830#issuecomment-832441074