generated from pangeo-gallery/example-gallery
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ghactions ci validation
- Loading branch information
Showing
3 changed files
with
75 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: validate | ||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- '**.ipynb' | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- '**.ipynb' | ||
|
||
jobs: | ||
build: | ||
name: validate notebooks | ||
runs-on: ubuntu-latest | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: setup env | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
activate-environment: cmip6env | ||
channels: conda-forge | ||
mamba-version: "*" | ||
channel-priority: strict | ||
auto-update-conda: false | ||
environment-file: environment.yml | ||
auto-activate-base: false | ||
|
||
- name: verify env | ||
run: | | ||
conda info | ||
conda list | ||
python -m ipykernel install --user --name cmip6env | ||
- name: get changed ipynb files | ||
id: changed-ipynb-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
**.ipynb | ||
- name: validate all changed ipynb files | ||
if: steps.changed-ipynb-files.outputs.any_changed == 'true' | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-ipynb-files.outputs.all_changed_files }} | ||
run: | | ||
for file in ${ALL_CHANGED_FILES}; do | ||
echo "$file was changed" | ||
papermill -k cmip6env $file - | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: cmip6env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- zarr | ||
- xarray | ||
- s3fs | ||
- gcsfs | ||
- cftime | ||
- nc-time-axis | ||
- papermill | ||
- notebook | ||
- matplotlib |