diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml new file mode 100644 index 0000000..00b979a --- /dev/null +++ b/.github/workflows/run.yml @@ -0,0 +1,45 @@ +name: Rerun the notebooks + +on: + pull_request: + push: + branches: + - main + # Run this action manually (this file needs to be in the default branch) + workflow_dispatch: + +jobs: + run-notebooks: + runs-on: ubuntu-latest + env: + PYTHON: "3.10" + + # Use bash by default in all jobs + defaults: + run: + shell: bash -el {0} + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: ${{ env.PYTHON }} + activate-environment: simpeg-user-tutorial + environment-file: environment.yml + auto-activate-base: false + + - name: List installed packages + run: | + conda info + conda list + + - name: Run notebook + run: | + for notebook in notebooks/**/*.ipynb; do + echo "Running '$notebook'" + jupyter execute --inplace $notebook + done diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..866be0b --- /dev/null +++ b/environment.yml @@ -0,0 +1,13 @@ +name: simpeg-user-tutorials +channels: + - conda-forge +dependencies: + - python=3.10.* + # Myst requirements + - nodejs>=20,<21 + - mystmd + # Notebook requirements + - jupyter + - SimPEG==0.20.* + - discretize==0.10.* + - pymatsolver