Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check notebooks #17

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: test

on:
zacharyburnett marked this conversation as resolved.
Show resolved Hide resolved
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 ]
exclude:
- os: macos-latest
python: '3.10'
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 ]
exclude:
- os: macos-latest
python: '3.10'
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: pip install 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