From 02d2d895fcd4db1afc6b089cd17f7ff63819d065 Mon Sep 17 00:00:00 2001 From: Marton Havasi Date: Wed, 11 Dec 2024 21:21:51 +0000 Subject: [PATCH] separate action for notebooks --- .github/workflows/ci.yaml | 10 ---------- .github/workflows/notebooks.yaml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/notebooks.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3757346..593cd3a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -31,16 +31,6 @@ jobs: run: | coverage run --include='flow_matching/**/*.py' -m unittest discover tests -v - - name: Run notebooks - shell: bash -l {0} - working-directory: examples - run: | - set -e - PYTHONPATH=../ - for file in ./*.ipynb; do - jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 "$file" - done - - name: Docstring Lint shell: bash -l {0} run: | diff --git a/.github/workflows/notebooks.yaml b/.github/workflows/notebooks.yaml new file mode 100644 index 0000000..fd3d416 --- /dev/null +++ b/.github/workflows/notebooks.yaml @@ -0,0 +1,31 @@ +name: Notebooks +on: push + +jobs: + run-notebooks: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - uses: mamba-org/setup-micromamba@v1.8.1 + with: + environment-file: environment.yml + cache-environment: true + + - name: Check GPU availability + shell: bash -l {0} + run: | + python -c "import torch; print('Is CUDA available:', torch.cuda.is_available())" + + - name: Import flow_matching + run: | + python -c "import flow_matching; print('flow_matching module imported successfully')" + + - name: Run notebooks + shell: bash -l {0} + working-directory: examples + run: | + set -e + PYTHONPATH=../ + for file in ./*.ipynb; do + jupyter nbconvert --to notebook --execute --ExecutePreprocessor.timeout=300 "$file" + done \ No newline at end of file