Skip to content

Commit d29f373

Browse files
authored
Merge pull request #49 from greg0ire/documentation
Implement documentation action
2 parents d3d1632 + 1f5dd0d commit d29f373

File tree

3 files changed

+78
-0
lines changed

3 files changed

+78
-0
lines changed

.github/workflows/documentation.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
name: "Documentation"
3+
4+
on:
5+
workflow_call:
6+
7+
jobs:
8+
guides:
9+
name: "phpDocumentor Guides"
10+
runs-on: "ubuntu-22.04"
11+
12+
strategy:
13+
matrix:
14+
php-version:
15+
- "8.3" # Use the same version as in doctrine/doctrine-website
16+
17+
steps:
18+
- name: "Checkout"
19+
uses: "actions/checkout@v4"
20+
21+
- name: "Install PHP"
22+
uses: "shivammathur/setup-php@v2"
23+
with:
24+
coverage: "none"
25+
php-version: "${{ matrix.php-version }}"
26+
tools: "cs2pr"
27+
28+
# Some of our dependencies have supported branches where they still need
29+
# to support PHP < 8.1. For that reason, let us not even attempt to install
30+
# the usual dependencies and start from scratch.
31+
- name: "Remove existing composer file"
32+
run: "rm composer.json"
33+
34+
- name: "Require phpdocumentor/guides-cli"
35+
# We use the same version constraint as in doctrine/doctrine-website
36+
run: "composer require --dev phpdocumentor/guides-cli '^1.4' --no-update"
37+
38+
- name: "Install dependencies with Composer"
39+
uses: "ramsey/composer-install@v3"
40+
with:
41+
dependency-versions: "highest"
42+
composer-options: "${{ inputs.composer-options }}"
43+
44+
- name: "Run guides"
45+
run: |
46+
vendor/bin/guides -vvv --no-progress --fail-on-log docs/en
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "Documentation",
3+
"description": "Validates the documentation",
4+
"iconName": "doctrine-logo",
5+
"categories": [
6+
"RST"
7+
],
8+
"filePatterns": [
9+
"^guides\\.xml$"
10+
]
11+
}

workflow-templates/documentation.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
name: "Documentation"
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- "*.x"
8+
paths:
9+
- ".github/workflows/documentation.yml"
10+
- "docs/**"
11+
push:
12+
branches:
13+
- "*.x"
14+
paths:
15+
- ".github/workflows/documentation.yml"
16+
- "docs/**"
17+
18+
jobs:
19+
documentation:
20+
name: "Documentation"
21+
uses: "doctrine/.github/.github/workflows/documentation.yml@use_a_valid_ref_here"

0 commit comments

Comments
 (0)