Skip to content

Commit 90f4032

Browse files
committed
:octocat: +phpdoc
1 parent e6dc3a4 commit 90f4032

File tree

3 files changed

+68
-3
lines changed

3 files changed

+68
-3
lines changed

.github/workflows/tests.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
# https://github.com/sebastianbergmann/phpunit/blob/master/.github/workflows/ci.yml
33

44
on:
5-
- pull_request
6-
- push
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
branches:
10+
- main
11+
712

813
name: "CI"
914

@@ -36,6 +41,33 @@ jobs:
3641
- name: "Run phan"
3742
run: php vendor/bin/phan
3843

44+
build-docs:
45+
name: "Build and publish Docs"
46+
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- name: "Checkout sources"
51+
uses: actions/checkout@v2
52+
53+
- name: "Install PHP"
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: "7.4"
57+
coverage: none
58+
tools: phpDocumentor
59+
extensions: json
60+
61+
- name: "Build Docs"
62+
run: phpdoc --config=phpdoc.xml
63+
64+
- name: "Publish Docs to gh-pages"
65+
uses: JamesIves/[email protected]
66+
with:
67+
BRANCH: gh-pages
68+
FOLDER: docs
69+
CLEAN: true
70+
3971
tests:
4072
name: "Unit Tests"
4173

@@ -50,7 +82,7 @@ jobs:
5082
php-version:
5183
- "7.4"
5284
- "8.0"
53-
# - "8.1"
85+
- "8.1"
5486

5587
steps:
5688
- name: "Configure git to avoid issues with line endings"

docs/Readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Auto generated API documentation
2+
3+
The API documentation can be auto generated with [phpDocumentor](https://www.phpdoc.org/).
4+
There is an [online version available](https://chillerlan.github.io/php-settings-container/) via the [gh-pages branch](https://github.com/chillerlan/php-settings-container/tree/gh-pages) that is [automatically deployed](https://github.com/chillerlan/php-settings-container/deployments) on each push to main.
5+
6+
Locally created docs will appear in this directory. If you'd like to create local docs, please follow these steps:
7+
8+
- [download phpDocumentor](https://github.com/phpDocumentor/phpDocumentor/releases) v3+ as .phar archive
9+
- run it in the repository root directory:
10+
- on Windows `c:\path\to\php.exe c:\path\to\phpDocumentor.phar --config=phpdoc.xml`
11+
- on Linux just `php /path/to/phpDocumentor.phar --config=phpdoc.xml`
12+
- open [index.html](./index.html) in a browser
13+
- profit!

phpdoc.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<phpdoc>
3+
<parser>
4+
<target>docs</target>
5+
<encoding>utf8</encoding>
6+
<markers>
7+
<item>TODO</item>
8+
</markers>
9+
</parser>
10+
<transformer>
11+
<target>docs</target>
12+
</transformer>
13+
<files>
14+
<directory>src</directory>
15+
<directory>tests</directory>
16+
</files>
17+
<transformations>
18+
<template name="responsive-twig"/>
19+
</transformations>
20+
</phpdoc>

0 commit comments

Comments
 (0)