Skip to content

Commit

Permalink
add ghactions validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jsta committed May 22, 2024
1 parent 9107d3b commit 2fe64eb
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: validate
on:
push:
branches:
- master
paths:
- '**.ipynb'
pull_request:
branches:
- master
paths:
- '**.ipynb'

jobs:
build:
name: validate notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: setup env
uses: conda-incubator/[email protected]
with:
miniforge-variant: Miniforge3
mamba-version: "*"
channels: conda-forge,nodefaults
channel-priority: true
activate-environment: cmip6
environment-file: environment.yml

- 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 cmip6 $file -
done
12 changes: 12 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: cmip6
channels:
- conda-forge
dependencies:
- zarr
- xarray
- s3fs
- gcsfs
- cftime
- nc-time-axis
- papermill
- matplotlib

0 comments on commit 2fe64eb

Please sign in to comment.