64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
name: CI
|
|
on:
|
|
workflow_dispatch: #allows repo admins to trigger this workflow from the Actions tab
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths-ignore:
|
|
- '.github/**'
|
|
- '!.github/workflows/main.yml'
|
|
- 'docs/**'
|
|
- '*.md'
|
|
- '.git*'
|
|
|
|
permissions:
|
|
contents: read # to fetch code (actions/checkout)
|
|
|
|
jobs:
|
|
test-notebooks:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
download: "true"
|
|
caching: "true"
|
|
strategy:
|
|
matrix:
|
|
py: ["3.11", "3.12", "3.13"]
|
|
nb_dec : ['[0-2]','[3-5]','[6-9]']
|
|
nb_unit: ['[0-2]','[3-5]','[6-9]']
|
|
steps:
|
|
- name: checkout contents of PR
|
|
uses: actions/checkout@v7
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{ matrix.py }}
|
|
cache: "pip"
|
|
cache-dependency-path: pyproject.toml
|
|
|
|
- name: Install libraries
|
|
run: |
|
|
pip install fastcore
|
|
pip install nbdev
|
|
pip install -Uq fastprogress
|
|
pip install -Uqe .[dev] --extra-index-url https://download.pytorch.org/whl/cpu
|
|
|
|
- name: check for cache hit
|
|
uses: actions/cache@v6
|
|
if: env.caching == 'true'
|
|
id: cache
|
|
with:
|
|
path: ~/.fastai/data
|
|
key: 'fastai-test-data-v3'
|
|
|
|
- name: download data
|
|
if: env.download == 'true' && steps.cache.outputs.cache-hit != 'true'
|
|
run: |
|
|
wget https://raw.githubusercontent.com/fastai/docker-containers/master/fastai/tmp_scripts/download_testdata.py
|
|
ipython download_testdata.py
|
|
mkdir -p $HOME/.fastai/data
|
|
find $HOME/.fastai/archive/ -name "*.tgz" -exec tar -xzvf {} -C $HOME/.fastai/data \;
|
|
- name: Test notebooks batch ${{matrix.nb_dec}}${{matrix.nb_unit}}
|
|
run: nbdev-test --flags '' --n_workers 3 --pause 1.0 --file_re "${{matrix.nb_dec}}${{matrix.nb_unit}}.*"
|
|
|