From a29dab69f00de1cec8ab3bd0f037d9e31772e26a Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Thu, 31 Oct 2024 08:48:19 -0700 Subject: [PATCH] Add CI check for downstream doc building (#4) * Add CI check for downstream doc building * we don't need to test python 3.9 or on windows IMHO * bump ci * test dirs * forgot to include other repo * messed up path to env * need env name since we don't have one in yaml * move path debugging before we try and install env * yaml not yml (thanks windows) * just use what is in our doc env like RTD does, also don't need a matrix * it would be best to not do a dev install since we don't on RTD * make sure we remove the version we installed from the yaml * bump CI * fixing unintall CI step * moving theme files to main dir * updating html_theme_path to match new dir structure * Revert "moving theme files to main dir" This reverts commit 663735536d149a85de2e207114473708d56f92bd. * Revert "updating html_theme_path to match new dir structure" This reverts commit 8f32fe9b7f7c62afbf6ae46083e264e14da07e20. * add package data paths to toml * add data paths to manifest instead * recursive include in manifest * add python -m for safety Co-authored-by: Irfan Alibay --------- Co-authored-by: Alyssa Travitz Co-authored-by: Alyssa Travitz <31974495+atravitz@users.noreply.github.com> Co-authored-by: Irfan Alibay --- .github/workflows/CI.yaml | 3 +- .github/workflows/test-doc-building.yaml | 60 ++++++++++++++++++++++++ MANIFEST.in | 1 + 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-doc-building.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index 8de03f8..d51e95e 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -29,9 +29,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macOS-latest, ubuntu-latest, windows-latest] + os: [macOS-latest, ubuntu-latest] python-version: - - "3.9" - "3.10" - "3.11" - "3.12" diff --git a/.github/workflows/test-doc-building.yaml b/.github/workflows/test-doc-building.yaml new file mode 100644 index 0000000..288c238 --- /dev/null +++ b/.github/workflows/test-doc-building.yaml @@ -0,0 +1,60 @@ +name: Test openfe doc building + +on: + push: + branches: + - "main" + pull_request: + branches: + - "main" + schedule: + - cron: "0 7 * * 0" + workflow_dispatch: + + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + + +defaults: + run: + shell: bash -leo pipefail {0} + + +jobs: + build_tests: + if: "github.repository == 'OpenFreeEnergy/ofe-sphinx-theme'" + name: Test Downstream Doc Building + runs-on: ubuntu-latest + steps: + + - name: Checkout ofe-sphinx-theme + uses: actions/checkout@v4 + with: + path: ofe + + - name: Checkout openfe + uses: actions/checkout@v4 + with: + repository: OpenFreeEnergy/openfe + path: openfe + + - name: Install OpenFE Doc Env + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: openfe/docs/environment.yaml + environment-name: test-env + + - name: Install ofe-sphinx-theme + run: | + # Remove the version we pulled in from the env and test + # the version on this PR + python -m pip uninstall ofe-sphinx-theme --yes + python -m pip install ofe/ + + - name: Install openfe + run: python -m pip install --no-deps openfe/ + + - name: Build the docs + run: python -m sphinx -T -W --keep-going -b html -d _build/doctrees -D language=en openfe/docs/ build_output/html diff --git a/MANIFEST.in b/MANIFEST.in index e0267af..42c0780 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include CODE_OF_CONDUCT.md +recursive-include ofe_sphinx_theme * global-exclude *.py[cod] __pycache__ *.so