diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ec1643b37..02f1d2035 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -195,12 +195,16 @@ jobs: # we might want to pin the SHA once merged coverage-comment: # Important: make sure to update the SHA after making any changes to the coverage workflow - uses: pydata/pydata-sphinx-theme/.github/workflows/coverage.yml@4a1e7898d6c92dade5e489684277ab4ffd0eb053 + # removing pin to test changes + uses: ./.github/workflows/coverage.yml needs: [coverage] # ensures this runs even if the coverage step does not continue - e.g. the # default coverage action will fail at first for external PRs, this is a workaround # to ensure the comment is posted - if: ${{ always() }} + if: ${{ github.event.name == 'pull_request'}} + with: + # this is the workflow run ID of the `CI.yml` workflow + workflow_run_id: ${{ github.event.workflow_run.id }} permissions: contents: write pull-requests: write diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 454d926b6..e18df714a 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,12 +2,15 @@ name: Post coverage comment on: workflow_call: - + inputs: + # this is the workflow run ID of the `CI.yml` workflow + workflow_run_id: + required: true + type: string jobs: test: name: "Display code coverage" runs-on: ubuntu-latest - if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' permissions: pull-requests: write contents: write # needed to edit the comment vs opening multiple ones @@ -21,7 +24,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPO: ${{ github.repository }} - WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }} + WORKFLOW_RUN_ID: ${{ inputs.workflow_run_id }} # this needs the .coverage file so we download from the CI workflow artifacts - name: "Download coverage data 📥" @@ -30,7 +33,7 @@ jobs: pattern: coverage-data-* merge-multiple: true github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} + run-id: ${{ inputs.workflow_run_id }} - name: "Check downloaded files" run: ls -R @@ -39,4 +42,4 @@ jobs: uses: py-cov-action/python-coverage-comment-action@b2eb38dd175bf053189b35f738f9207278b00925 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }} + GITHUB_PR_RUN_ID: ${{ inputs.workflow_run_id }} diff --git a/.github/workflows/rtd-preview-link.yml b/.github/workflows/rtd-preview-link.yml deleted file mode 100644 index dd94e540e..000000000 --- a/.github/workflows/rtd-preview-link.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Workflow to add a comment to a PR with a link to the preview of the docs - -name: rtd-preview-link - -on: - pull_request: - types: [opened] - -permissions: {} - -jobs: - add-preview-link: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - uses: readthedocs/actions/preview@b8bba1484329bda1a3abe986df7ebc80a8950333 - with: - project-slug: "pydata-sphinx-theme" diff --git a/docs/conf.py b/docs/conf.py index e7a82a1c9..503c6beb7 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -358,6 +358,8 @@ def setup(app: Sphinx) -> Dict[str, Any]: } +# -- linkcheck options --------------------------------------------------------- + linkcheck_anchors_ignore = [ # match any anchor that starts with a '/' since this is an invalid HTML anchor r"\/.*", @@ -399,3 +401,7 @@ def setup(app: Sphinx) -> Dict[str, Any]: r"http://www.yahoo.com": "https://www.yahoo.com/", r"https://feature-engine.readthedocs.io/": "https://feature-engine.trainindata.com/en/latest/", } + +# we have had issues with linkcheck timing and retries on www.gnu.org +linkcheck_retries = 3 +linkcheck_timeout = 50