diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e5b73c6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: + push: + branches: + - "**" + pull_request: + branches: + - main + schedule: + - cron: "0 0 * * WED" + workflow_dispatch: + +jobs: + test_colab: + uses: fem-on-colab/open-in-colab-workflow/.github/workflows/workflow_call.yml@main + with: + work_directory: notebooks_copy + notebook_pattern: "**/*.ipynb" + notebook_preparation: | + rsync -avz --include="*.ipynb" --exclude="*" . notebooks_copy/ + test_script: | + python3 -m pytest --nbval notebooks_copy + publish_on: artifact@notebooks + + warn: + runs-on: ubuntu-latest + if: github.repository == 'firedrakeproject/notebooks' && github.ref == 'refs/heads/main' && github.event_name == 'schedule' + steps: + - name: Warn if scheduled workflow is about to be disabled + uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main + with: + workflow-filename: ci.yml + days-elapsed: 50 diff --git a/01-spd-helmholtz.ipynb b/01-spd-helmholtz.ipynb index cb7d16a..e895f24 100644 --- a/01-spd-helmholtz.ipynb +++ b/01-spd-helmholtz.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/02-poisson.ipynb b/02-poisson.ipynb index ff5877a..fed9e2c 100644 --- a/02-poisson.ipynb +++ b/02-poisson.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/03-elasticity.ipynb b/03-elasticity.ipynb index 8ead1db..4d27ff0 100644 --- a/03-elasticity.ipynb +++ b/03-elasticity.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/04-burgers.ipynb b/04-burgers.ipynb index deb4e16..068ef5b 100644 --- a/04-burgers.ipynb +++ b/04-burgers.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/05-mixed-poisson.ipynb b/05-mixed-poisson.ipynb index 9442802..58913c3 100644 --- a/05-mixed-poisson.ipynb +++ b/05-mixed-poisson.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/06-pde-constrained-optimisation.ipynb b/06-pde-constrained-optimisation.ipynb index 5e5f8e7..c3ab92c 100644 --- a/06-pde-constrained-optimisation.ipynb +++ b/06-pde-constrained-optimisation.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, @@ -126,6 +126,15 @@ "This problem setup requires a mesh that is more complex than the built in ones Firedrake provides. Instead, it was created with [Gmsh](http://gmsh.info). It is loaded by using the `Mesh` constructor, passing the filename of the mesh in question." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "!rm -f stokes-control.msh && wget https://raw.githubusercontent.com/firedrakeproject/notebooks/refs/heads/main/stokes-control.msh" + ] + }, { "cell_type": "code", "execution_count": null, diff --git a/07-geometric-multigrid.ipynb b/07-geometric-multigrid.ipynb index 1f03379..883cbfb 100644 --- a/07-geometric-multigrid.ipynb +++ b/07-geometric-multigrid.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/08-composable-solvers.ipynb b/08-composable-solvers.ipynb index a2eed7f..aff1005 100644 --- a/08-composable-solvers.ipynb +++ b/08-composable-solvers.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/09-hybridisation.ipynb b/09-hybridisation.ipynb index 5cc3317..8e51d0f 100644 --- a/09-hybridisation.ipynb +++ b/09-hybridisation.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/10-sum-factorisation.ipynb b/10-sum-factorisation.ipynb index 4ba294c..c157df9 100644 --- a/10-sum-factorisation.ipynb +++ b/10-sum-factorisation.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/11-extract-adjoint-solutions.ipynb b/11-extract-adjoint-solutions.ipynb index afee756..0c72c58 100644 --- a/11-extract-adjoint-solutions.ipynb +++ b/11-extract-adjoint-solutions.ipynb @@ -9,7 +9,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/12-HPC_demo.ipynb b/12-HPC_demo.ipynb index 624a7c5..47c2706 100644 --- a/12-HPC_demo.ipynb +++ b/12-HPC_demo.ipynb @@ -10,7 +10,7 @@ "try:\n", " import firedrake\n", "except ImportError:\n", - " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", + " !wget \"https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh\" -O \"/tmp/firedrake-install.sh\" && bash \"/tmp/firedrake-install.sh\"\n", " import firedrake" ] }, diff --git a/utils/firedrake-colab-notebooks b/utils/firedrake-colab-notebooks index fe9997a..bd13ec2 100755 --- a/utils/firedrake-colab-notebooks +++ b/utils/firedrake-colab-notebooks @@ -25,7 +25,7 @@ colab_cell = nbformat.notebooknode.NotebookNode({ 'source': '''try: import firedrake except ImportError: - !wget "https://fem-on-colab.github.io/releases/firedrake-install-real.sh" -O "/tmp/firedrake-install.sh" && bash "/tmp/firedrake-install.sh" + !wget "https://fem-on-colab.github.io/releases/firedrake-install-release-real.sh" -O "/tmp/firedrake-install.sh" && bash "/tmp/firedrake-install.sh" import firedrake''' })