Update index.md #475
Workflow file for this run
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: NetworkX Notebooks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 12 | |
matrix: | |
os: [Ubuntu-22.04, macOS-latest] | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Before install | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
sudo apt-get update | |
sudo apt-get install graphviz graphviz-dev | |
elif [ "$RUNNER_OS" == "macOS" ]; then | |
brew install graphviz pkg-config | |
fi | |
python3 -m venv ~/venv | |
source ~/venv/bin/activate | |
- name: Install dependencies | |
run: | | |
pip install -U pip | |
pip install -r requirements.txt | |
- name: Lint with precommit | |
run: | | |
pip install pre-commit | |
find content/ -name "*.md" -exec jupytext --to notebook {} \; | |
# pre-commit wants files to be staged | |
find content/ -name "*.ipynb" -exec git add {} \; | |
pre-commit run --all-files --show-diff-on-failure --color always | |
- name: Test with nbval | |
run: | | |
find content/algorithms content/generators -name "*.md" -exec jupytext --to notebook {} \; | |
find content/algorithms content/generators -name "*.ipynb" -print | |
pip install pytest | |
pytest --nbval-lax --durations=25 content/algorithms content/generators |