From 477de815442b8d4a99ddd36d8a1291a9c266fc68 Mon Sep 17 00:00:00 2001 From: Tania Allard Date: Mon, 15 Jul 2024 20:28:18 +0100 Subject: [PATCH] DEV - Miscellaneous enhancements to CI (#1928) This PR includes a couple of fixes to the CI workflows: - Moves the installation of Graphviz to our reusable setup action and uses third-party action - Ensures Graphviz is installed in the a11y tests - Adds a note about needing to install Graphviz to build our documentation - Re-adds CI permissions for the coverage action (that has led to fails in our scheduled CI https://github.com/pydata/pydata-sphinx-theme/actions/workflows/publish.yml) --------- Co-authored-by: Daniel McCloy --- .github/actions/set-dev-env/action.yml | 10 +++++++++- .github/workflows/CI.yml | 19 ++++++------------- docs/community/setup.md | 4 +++- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.github/actions/set-dev-env/action.yml b/.github/actions/set-dev-env/action.yml index ec67801bc..7964b4365 100644 --- a/.github/actions/set-dev-env/action.yml +++ b/.github/actions/set-dev-env/action.yml @@ -9,7 +9,11 @@ inputs: pandoc: description: Whether this should install pandoc or not required: false - default: "False" + default: "false" + graphviz: + description: Whether this should install Graphviz or not + required: false + default: "false" runs: using: composite @@ -30,3 +34,7 @@ runs: with: pandoc-version: "latest" if: ${{ inputs.pandoc }} == true + + - name: "Install Graphviz" + uses: ts-graphviz/setup-graphviz@v2 + if: ${{ inputs.graphviz }} == true diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 024852f00..0eef947b2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -103,6 +103,8 @@ jobs: uses: ./.github/actions/set-dev-env with: python-version: ${{ env.DEFAULT_PYTHON_VERSION }} + pandoc: true + graphviz: true - name: "Run accessibility tests with playwright 🎭" # build PST, build docs, then run a11y-tests run: python -Im tox run -e py312-docs,a11y-tests @@ -129,19 +131,7 @@ jobs: with: python-version: ${{ matrix.python-version }} pandoc: true - - name: "Install Graphviz on Windows 🗔" - if: runner.os == 'Windows' - run: choco install graphviz - - name: "Install Graphviz on macOS " - if: runner.os == 'macOS' - run: | - brew update - brew install graphviz - - name: "Install Graphviz on Linux 🐧" - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends graphviz + graphviz: true - name: "Build docs and check for warnings 📖" shell: bash run: | @@ -191,6 +181,9 @@ jobs: name: "check coverage" needs: run-pytest runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - name: "Checkout repository 🛎" uses: actions/checkout@v4 diff --git a/docs/community/setup.md b/docs/community/setup.md index 87b347611..9e397bbcb 100644 --- a/docs/community/setup.md +++ b/docs/community/setup.md @@ -122,8 +122,10 @@ The caveat to using `tox` is that this will not install the required hooks to ru ## Build the documentation -Now that you have `tox` installed and cloned the repository, you should be able to build the documentation locally. +Now that you have `tox` installed and cloned the repository, you will need to install Graphviz to build the documentation. +To install Graphviz, follow the instructions in the [Graphviz documentation for your operating system](https://graphviz.org/download/). +Once you have `tox` and Graphviz installed, you can build the documentation. To build the documentation with `tox`, run the following command: ```console