WIP: update to support NetworkX 3.3 (dev), and other maintenance #282
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: Tests | |
on: | |
pull_request: | |
push: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup mamba | |
uses: conda-incubator/setup-miniconda@v3 | |
id: setup_mamba | |
continue-on-error: true | |
with: | |
miniforge-variant: Mambaforge | |
miniforge-version: latest | |
use-mamba: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge,${{ contains(matrix.python-version, 'pypy') && 'defaults' || 'nodefaults' }} | |
channel-priority: ${{ contains(matrix.python-version, 'pypy') && 'flexible' || 'strict' }} | |
activate-environment: graphblas | |
auto-activate-base: false | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v3 | |
id: setup_conda | |
if: steps.setup_mamba.outcome == 'failure' | |
continue-on-error: false | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python-version }} | |
channels: conda-forge,${{ contains(matrix.python-version, 'pypy') && 'defaults' || 'nodefaults' }} | |
channel-priority: ${{ contains(matrix.python-version, 'pypy') && 'flexible' || 'strict' }} | |
activate-environment: graphblas | |
auto-activate-base: false | |
- name: Install dependencies | |
run: | | |
$(command -v mamba || command -v conda) install python-suitesparse-graphblas scipy pandas donfig pyyaml numpy python-graphblas \ | |
pytest-cov pytest-randomly pytest-mpl networkx | |
# matplotlib lxml pygraphviz pydot sympy # Extra networkx deps we don't need yet | |
# Sometimes we prefer to use the latest release of NetworkX or the latest development from github | |
# pip install git+https://github.com/networkx/networkx.git@main --no-deps | |
pip install -e . --no-deps | |
- name: PyTest | |
run: | | |
python -c 'import sys, graphblas_algorithms; assert "networkx" not in sys.modules' | |
coverage run --branch -m pytest --color=yes -v --check-structure | |
coverage report | |
# NETWORKX_GRAPH_CONVERT=graphblas pytest --color=yes --pyargs networkx --cov --cov-append | |
./run_nx_tests.sh --color=yes --cov --cov-append | |
coverage report | |
coverage xml | |
- name: Coverage | |
uses: codecov/codecov-action@v3 |