From f8180936415fc4bb0c6f44ed149d16a02f2b21fb Mon Sep 17 00:00:00 2001 From: Kirk Bonney <47759761+kbonney@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:32:40 -0700 Subject: [PATCH] Update workflows to test documentation (#453) * run doctests on quick_check * update documentation workflow to test documentation building on pull requests. --- .github/workflows/build_deploy_pages.yml | 6 ++++-- .github/workflows/quick_check.yml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_deploy_pages.yml b/.github/workflows/build_deploy_pages.yml index 47d69eaf7..7c4c627e1 100644 --- a/.github/workflows/build_deploy_pages.yml +++ b/.github/workflows/build_deploy_pages.yml @@ -1,11 +1,12 @@ -# This is a basic workflow to help you get started with Actions - name: docs on: push: branches: [main] + pull_request: + branches: [main] workflow_dispatch: + jobs: build: name: Build the documentation with Sphinx @@ -36,6 +37,7 @@ jobs: deploy: name: Deploy documentation to GitHub Pages needs: build + if: github.event_name == 'push' permissions: contents: read pages: write # to deploy to Pages diff --git a/.github/workflows/quick_check.yml b/.github/workflows/quick_check.yml index ce83b425b..c30c9060c 100644 --- a/.github/workflows/quick_check.yml +++ b/.github/workflows/quick_check.yml @@ -33,7 +33,8 @@ jobs: python -m pip install -e . - name: Run tests and coverage (unittests plus doctests) run: | - coverage run --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" -m pytest -m "not time_consuming" --doctest-modules --doctest-glob="*.rst" wntr + coverage run --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" -m pytest -m "not time_consuming" --doctest-modules --doctest-glob="*.rst" wntr + coverage run --source=wntr --omit="*/tests/*","*/sim/network_isolation/network_isolation.py","*/sim/aml/evaluator.py" --append -m pytest --doctest-glob="*.rst" documentation coverage report --fail-under=70 # coverage run --source=wntr --omit="*/tests/*" --append -m pytest --doctest-glob="*.rst" documentation