Skip to content

Sphinx doc attempt (merge after testing refactoring) #190

Sphinx doc attempt (merge after testing refactoring)

Sphinx doc attempt (merge after testing refactoring) #190

Workflow file for this run

name: build
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y libsuitesparse-dev
python -m pip install --upgrade pip
# pip install .
pip install -e ".[sparse]"
# pip install flake8 pytest
# if [ -f requirements.txt ]; then pip install -r requirements-test.txt; fi
- name: pytest
run: |
pip install -e ".[sparse,test]"
python -m pytest -n auto optimism --cov=optimism -Wignore
# we can also add the flag -n auto for parallel testing
- name: docs
run: |
pip install -e ".[docs,sparse,test]"
cd docs
sphinx-apidoc -o source/ ../optimism -P
make html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html # Adjust this if your output directory is different
publish_branch: gh-pages # The branch to deploy to
- name: codecov
uses: codecov/codecov-action@v4
with:
files: .coverage
token: ${{ secrets.CODECOV_TOKEN }}