From c184de289a280c9db0668620eb605f5c0067e056 Mon Sep 17 00:00:00 2001 From: Tarek Ismail Date: Thu, 3 Oct 2024 09:58:54 +0300 Subject: [PATCH] Copy over documentation workflow and add tmate "debugging" --- .github/workflows/automatic-doc-checks.yml | 16 --- .github/workflows/documentation-checks.yaml | 122 ++++++++++++++++++++ 2 files changed, 122 insertions(+), 16 deletions(-) delete mode 100644 .github/workflows/automatic-doc-checks.yml create mode 100644 .github/workflows/documentation-checks.yaml diff --git a/.github/workflows/automatic-doc-checks.yml b/.github/workflows/automatic-doc-checks.yml deleted file mode 100644 index ffe972d060c..00000000000 --- a/.github/workflows/automatic-doc-checks.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Main Documentation Checks - -on: - - push - - pull_request - - workflow_dispatch - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - documentation-checks: - uses: canonical/documentation-workflows/.github/workflows/documentation-checks.yaml@main - with: - working-directory: doc/sphinx diff --git a/.github/workflows/documentation-checks.yaml b/.github/workflows/documentation-checks.yaml new file mode 100644 index 00000000000..fa8d9e815bd --- /dev/null +++ b/.github/workflows/documentation-checks.yaml @@ -0,0 +1,122 @@ +name: Automatic documentation checks + +on: + workflow_call: + inputs: + working-directory: + description: 'Working directory' + required: true + type: string + python-version: + description: 'Version of the Python interpreter to use (defaults to 3.10)' + required: false + type: string + default: '3.10' + makefile: + description: 'Name of the Makefile to use (default: "Makefile.sp" if it exists, "Makefile" otherwise)' + required: false + type: string + default: 'use-default' + install-target: + description: 'Target to run to install the tools (default: "install")' + required: false + type: string + default: 'install' + spelling-target: + description: 'Target to run for the spelling check (default: "spelling")' + required: false + type: string + default: 'spelling' + woke-target: + description: 'Target to run for the inclusive language check (default: "woke")' + required: false + type: string + default: 'woke' + linkcheck-target: + description: 'Target to run for the link check (default: "linkcheck")' + required: false + type: string + default: 'linkcheck' + pa11y-target: + description: 'Target to run for the accessibility check (default: "pa11y")' + required: false + type: string + default: 'pa11y' + outputs: + spellcheck-result: + description: "Result of the spelling check" + value: ${{ jobs.docchecks.outputs.result_spelling }} + woke-result: + description: "Result of the inclusive language check" + value: ${{ jobs.docchecks.outputs.result_woke }} + linkcheck-result: + description: "Result of the link check" + value: ${{ jobs.docchecks.outputs.result_links }} + pa11y-result: + description: "Result of the pa11y check" + value: ${{ jobs.docchecks.outputs.result_pa11y }} + +jobs: + docchecks: + name: Run documentation checks + runs-on: ubuntu-22.04 + outputs: + result_spelling: ${{ steps.spellcheck-step.outcome }} + result_woke: ${{ steps.woke-step.outcome }} + result_links: ${{ steps.linkcheck-step.outcome }} + result_pa11y: ${{ steps.pa11y-step.outcome }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ inputs.python-version }} + + - name: Spell Check + id: spellcheck-step + if: success() || failure() + uses: canonical/documentation-workflows/spellcheck@main + with: + working-directory: ${{ inputs.working-directory }} + install-target: ${{ inputs.install-target }} + spelling-target: ${{ inputs.spelling-target }} + makefile: ${{ inputs.makefile }} + + - name: Inclusive Language Check + id: woke-step + if: success() || failure() + uses: canonical/documentation-workflows/inclusive-language@main + with: + working-directory: ${{ inputs.working-directory }} + install-target: ${{ inputs.install-target }} + woke-target: ${{ inputs.woke-target }} + makefile: ${{ inputs.makefile }} + + - name: Link Check + id: linkcheck-step + if: success() || failure() + uses: canonical/documentation-workflows/linkcheck@main + with: + working-directory: ${{ inputs.working-directory }} + install-target: ${{ inputs.install-target }} + linkcheck-target: ${{ inputs.linkcheck-target }} + makefile: ${{ inputs.makefile }} + + - name: Accessibility Check + id: pa11y-step + continue-on-error: true + if: success() || failure() + uses: canonical/documentation-workflows/pa11y@main + with: + working-directory: ${{ inputs.working-directory }} + install-target: ${{ inputs.install-target }} + pa11y-target: ${{ inputs.pa11y-target }} + makefile: ${{ inputs.makefile }} + + - if: ${{ failure() && runner.debug }} + name: Setup upterm session + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true