diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..5a01c66 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,46 @@ + +name: "Documentation" + +on: + workflow_call: + +jobs: + guides: + name: "phpDocumentor Guides" + runs-on: "ubuntu-22.04" + + strategy: + matrix: + php-version: + - "8.3" # Use the same version as in doctrine/doctrine-website + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + tools: "cs2pr" + + # Some of our dependencies have supported branches where they still need + # to support PHP < 8.1. For that reason, let us not even attempt to install + # the usual dependencies and start from scratch. + - name: "Remove existing composer file" + run: "rm composer.json" + + - name: "Require phpdocumentor/guides-cli" + # We use the same version constraint as in doctrine/doctrine-website + run: "composer require --dev phpdocumentor/guides-cli '^1.4' --no-update" + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v3" + with: + dependency-versions: "highest" + composer-options: "${{ inputs.composer-options }}" + + - name: "Run guides" + run: | + vendor/bin/guides -vvv --no-progress --fail-on-log docs/en diff --git a/workflow-templates/documentation.properties.json b/workflow-templates/documentation.properties.json new file mode 100644 index 0000000..930d02d --- /dev/null +++ b/workflow-templates/documentation.properties.json @@ -0,0 +1,11 @@ +{ + "name": "Documentation", + "description": "Validates the documentation", + "iconName": "doctrine-logo", + "categories": [ + "RST" + ], + "filePatterns": [ + "^guides\\.xml$" + ] +} diff --git a/workflow-templates/documentation.yml b/workflow-templates/documentation.yml new file mode 100644 index 0000000..1cd616a --- /dev/null +++ b/workflow-templates/documentation.yml @@ -0,0 +1,21 @@ + +name: "Documentation" + +on: + pull_request: + branches: + - "*.x" + paths: + - ".github/workflows/documentation.yml" + - "docs/**" + push: + branches: + - "*.x" + paths: + - ".github/workflows/documentation.yml" + - "docs/**" + +jobs: + documentation: + name: "Documentation" + uses: "doctrine/.github/.github/workflows/documentation.yml@use_a_valid_ref_here"