Skip to content

bump version

bump version #91

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches: ["main", "master"]
pull_request:
jobs:
nbdev-sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: settings.ini
- name: Test ibrary Sync
shell: bash
run: |
set -ux
python -m pip install --upgrade pip
pip install -U nbdev
echo "Check we are starting with clean git checkout"
if [[ `git status --porcelain -uno` ]]; then
git diff
echo "git status is not clean"
false
fi
echo "Trying to strip out notebooks"
nbdev_clean
echo "Check that strip out was unnecessary"
git status -s # display the status to see which nbs need cleaning up
if [[ `git status --porcelain -uno` ]]; then
git status -uno
echo -e "!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_hooks"
echo -e "This error can also happen if you are using an older version of nbdev relative to what is in CI. Please try to upgrade nbdev with the command `pip install -U nbdev`"
false
fi
nbdev_export
if [[ `git status --porcelain -uno` ]]; then
echo "::error::Notebooks and library are not in sync. Please run nbdev_export."
git status -uno
git diff
exit 1;
fi
integration-tests:
needs: nbdev-sync
runs-on: ubuntu-latest
strategy:
matrix:
backend: [jax, torch, tf, hf]
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: settings.ini
- name: Install Base Dependencies
run: |
pip install --upgrade pip
pip install -e .
pip install pytest
- name: Test JAX backend
if: ${{ matrix.backend == 'jax'}}
run: |
pytest integration_tests/jax_test.py
- name: Test Pytorch Dependencies
if: ${{ matrix.backend == 'torch'}}
run: |
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pytest integration_tests/torch_test.py
- name: Test Tensorflow Dependencies
if: ${{ matrix.backend == 'tf'}}
run: |
pip install -e .[tensorflow]
pytest integration_tests/tf_test.py
- name: Test Huggingface Dependencies
if: ${{ matrix.backend == 'hf'}}
run: |
pip install -e .[huggingface]
pytest integration_tests/hf_test.py
nbdev-tests:
needs: nbdev-sync
runs-on: ubuntu-latest
strategy:
matrix:
py: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
cache: "pip"
cache-dependency-path: settings.ini
- name: Install Library
run: |
pip install --upgrade pip
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
pip install -e .[dev]
- name: Run Tests
run: nbdev_test
- name: test docs build
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') && matrix.version == '3.9' && matrix.os == 'ubuntu' }}
run: |
set -ux
wget -q $(curl https://latest.fast.ai/pre/quarto-dev/quarto-cli/linux-amd64.deb)
sudo dpkg -i quarto*.deb
nbdev_mkdocs docs
if [ -f "_docs/index.html" ]; then
echo "docs built successfully."
else
echo "index page not found in rendered docs."
ls -la
ls -la _docs
exit 1
fi
# - name: Run Docs
# run: nbdev_mkdocs prepare
# - name: Install and Test Everything
# run: |
# pip install -e .[all]
# nbdev_test --flags "torch hf tf"
# - name: Install and Test Torch
# run: |
# pip install -e .[torch]
# nbdev_test --flags torch
# - name: Install and Test Huggingface
# run: |
# pip install -e .[huggingface]
# nbdev_test --flags hf
# - name: Install and Test Tensorflow
# run: |
# pip install -e .[tensorflow]
# nbdev_test --flags tf