Skip to content

On Push DOC checks - main by caciolai #134

On Push DOC checks - main by caciolai

On Push DOC checks - main by caciolai #134

Workflow file for this run

name: Check Documentation
run-name: On Push DOC checks - ${{ github.ref_name }} by ${{ github.actor }}
on:
push:
workflow_call:
inputs:
working-directory:
description: 'Working directory to run tests in'
required: false
type: string
default: '.'
use-artifact:
description: 'Name of artifact to download and use as working directory'
required: false
type: string
default: ''
permissions:
contents: read
env:
WORKING_DIR: ${{ inputs.use-artifact != '' && format('{0}/oss-content', inputs.working-directory) || inputs.working-directory }}
jobs:
check-rst-files:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- name: Check if RST files exist in docs folder
id: check-rst
working-directory: ${{ env.WORKING_DIR }}
run: |
if [ -d "docs" ] && find docs -name "*.rst" -type f | grep -q .; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "RST files found in docs folder"
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "No RST files found in docs folder"
fi
outputs:
rst-exists: ${{ steps.check-rst.outputs.exists }}
codespell-check:
runs-on: ubuntu-latest
needs: check-rst-files
if: needs.check-rst-files.outputs.rst-exists == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download artifact
if: inputs.use-artifact != ''
uses: actions/download-artifact@v4
with:
name: ${{ inputs.use-artifact }}
path: ${{ inputs.working-directory }}/oss-content
- uses: ./.github/actions/setup-python-uv
- name: Run codespell on RST files in docs folder
working-directory: ${{ env.WORKING_DIR }}
run: |
echo "Running codespell on RST files in docs folder..."
find docs -name "*.rst" -type f -print0 | xargs -0 uv run --extra dev codespell --check-filenames