Skip to content

Commit

Permalink
check notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyburnett committed Jul 21, 2022
1 parent 6e771de commit e8ee6c0
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 0 deletions.
106 changes: 106 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: test

on:
push:
paths:
- '**/*.ipynb'
- '**/*.yml'
- '**/*.yaml'
- '**/*.py'
pull_request:
branches:
- main
paths:
- '**/*.ipynb'
- '**/*.yml'
- '**/*.yaml'
- '**/*.py'

defaults:
run:
shell: bash -l {0}

jobs:
build:
name: build environment (Python ${{ matrix.python }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: [ '3.9', '3.10' ]
os: [ ubuntu-latest, macos-latest ]
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
- uses: mtkennerly/[email protected]
id: version
- run: echo "::set-output name=date::$(date +'%Y%m%d')"
id: date
- uses: actions/[email protected]
if: runner.os == 'Linux'
with:
path: |
/home/runner/conda_pkgs_dir
/usr/share/miniconda/envs/asdf-tutorial-${{ runner.os }}-py${{ matrix.python }}-latest
key: conda-${{ runner.os }}-py${{ matrix.python }}-${{ steps.date.outputs.date }}
- uses: actions/[email protected]
if: runner.os == 'MacOS'
with:
path: |
/Users/runner/conda_pkgs_dir
/usr/local/miniconda/envs/asdf-tutorial-${{ runner.os }}-py${{ matrix.python }}-latest
key: conda-${{ runner.os }}-py${{ matrix.python }}-${{ steps.date.outputs.date }}
- uses: conda-incubator/[email protected]
with:
activate-environment: asdf-tutorial-${{ runner.os }}-py${{ matrix.python }}-latest
environment-file: environment.yml
python-version: ${{ matrix.python }}.*
auto-update-conda: true
use-only-tar-bz2: true
- run: conda env export > asdf-tutorial-py${{ matrix.python }}-v${{ steps.version.outputs.version }}.yml
if: runner.os == 'Linux'
- run: cat asdf-tutorial-py${{ matrix.python }}-v${{ steps.version.outputs.version }}.yml
if: runner.os == 'Linux'
- uses: actions/[email protected]
if: runner.os == 'Linux'
with:
name: asdf-tutorial-py${{ matrix.python }}-v${{ steps.version.outputs.version }}.yml
path: asdf-tutorial-py${{ matrix.python }}-v${{ steps.version.outputs.version }}.yml
run_notebooks:
name: run notebooks (Python ${{ matrix.python }}, ${{ matrix.os }})
needs: [ build ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: [ '3.9', '3.10' ]
os: [ ubuntu-latest, macos-latest ]
steps:
- uses: actions/[email protected]
- run: echo "::set-output name=date::$(date +'%Y%m%d')"
id: date
- uses: actions/[email protected]
if: runner.os == 'Linux'
with:
path: |
/home/runner/conda_pkgs_dir
/usr/share/miniconda/envs/asdf-tutorial-${{ runner.os }}-py${{ matrix.python }}-latest
key: conda-${{ runner.os }}-py${{ matrix.python }}-${{ steps.date.outputs.date }}
- uses: actions/[email protected]
if: runner.os == 'MacOS'
with:
path: |
/Users/runner/conda_pkgs_dir
/usr/local/miniconda/envs/asdf-tutorial-${{ runner.os }}-py${{ matrix.python }}-latest
key: conda-${{ runner.os }}-py${{ matrix.python }}-${{ steps.date.outputs.date }}
- uses: conda-incubator/[email protected]
with:
activate-environment: asdf-tutorial-${{ runner.os }}-py${{ matrix.python }}-latest
environment-file: environment.yml
python-version: ${{ matrix.python }}.*
auto-update-conda: true
use-only-tar-bz2: true
- run: conda install -y nbcollection
- run: python -m nbcollection execute .
14 changes: 14 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: asdf-tutorial-env

dependencies:
- jupyter
- matplotlib
- numpy
- pip
- python >= 3.9
- pip:
- asdf
- asdf-astropy
- asdf-standard
- astropy
- gwcs

0 comments on commit e8ee6c0

Please sign in to comment.