Skip to content

examples tests

examples tests #909

Workflow file for this run

name: examples tests
on:
push:
branches: [doc]
schedule:
- cron: '0 3 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v2
with:
ref: doc
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov geopandas nbconvert matplotlib descartes
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test all examples
env:
insee_key: ${{ secrets.INSEE_KEY }}
insee_secret: ${{ secrets.INSEE_SECRET }}
run: |
pip install jupytext
pip install .[full]
pip install -r docs/requirements.txt
# test all notebooks
cd docs/examples
# delete py existing files
for f in *.py; do rm "$f"; done
# convert notebooks to py files
jupytext --to py *.ipynb
# run all py files
for f in *.py; do echo "$f"; python "$f"; done
cd ../..
- name: Test idbank list download
env:
insee_key: ${{ secrets.INSEE_KEY }}
insee_secret: ${{ secrets.INSEE_SECRET }}
run: |
pip install .
python -c "from pynsee.macrodata._dwn_idbank_files import _dwn_idbank_files;_dwn_idbank_files()"