Skip to content

Commit

Permalink
Merge pull request #49 from greg0ire/documentation
Browse files Browse the repository at this point in the history
Implement documentation action
  • Loading branch information
greg0ire authored Sep 29, 2024
2 parents d3d1632 + 1f5dd0d commit d29f373
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 11 additions & 0 deletions workflow-templates/documentation.properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Documentation",
"description": "Validates the documentation",
"iconName": "doctrine-logo",
"categories": [
"RST"
],
"filePatterns": [
"^guides\\.xml$"
]
}
21 changes: 21 additions & 0 deletions workflow-templates/documentation.yml
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit d29f373

Please sign in to comment.