This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
Bump version #472
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
name: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
nbdev-sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
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 | |
nbdev-test: | |
needs: nbdev-sync | |
strategy: | |
fail-fast: true | |
matrix: | |
py: ['3.8', '3.9', '3.10', '3.11'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.py }} | |
cache: "pip" | |
cache-dependency-path: settings.ini | |
- name: Install Library | |
run: | | |
pip install --upgrade pip | |
pip install -e .[dev] | |
# install causal graphical models | |
pip install git+https://github.com/BirkhoffG/causalgraphicalmodels.git --upgrade | |
- name: Run Tests | |
run: nbdev_test | |
- name: test docs build | |
if: ${{ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') && matrix.version == '3.8' && 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_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 | |
# strategy: | |
# fail-fast: true | |
# matrix: | |
# os: [ubuntu] | |
# version: ["3.8", "3.9", "3.10", "3.11"] | |
# runs-on: ${{ matrix.os }}-latest | |
# steps: | |
# - uses: fastai/workflows/nbdev-ci@master | |
# with: | |
# version: "3.8" | |
# # version: ${{ matrix.version }} | |
# skip_test: true | |
# - name: test docs build | |
# if: ${{ (github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch') && matrix.version == '3.8' && 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_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 |