Skip to content

Commit ce018de

Browse files
committed
Add missing docs check
1 parent 3827b67 commit ce018de

20 files changed

Lines changed: 1385 additions & 604 deletions

‎.github/workflows/docs-check.yml‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Check Docs"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "[0-9]+.[0-9]+.x"
10+
11+
jobs:
12+
checkdocs:
13+
name: "Check Docs"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "8.5"
23+
operating-system:
24+
- "ubuntu-latest"
25+
26+
steps:
27+
- name: "Checkout"
28+
uses: actions/checkout@v7
29+
30+
- name: "Install PHP"
31+
uses: "shivammathur/setup-php@2.37.2"
32+
with:
33+
coverage: none
34+
php-version: "${{ matrix.php-version }}"
35+
ini-values: memory_limit=-1, opcache.enable_cli=1
36+
37+
- uses: ramsey/composer-install@4.0.0
38+
with:
39+
dependency-versions: ${{ matrix.dependencies }}
40+
41+
- name: "extract php code"
42+
run: "bin/docs-extract-php-code"
43+
44+
- name: "lint php"
45+
run: "php -l docs_php/*.php"
46+
47+
- name: "docs code style"
48+
run: "vendor/bin/phpcbf docs_php --exclude=SlevomatCodingStandard.TypeHints.DeclareStrictTypes,SlevomatCodingStandard.ControlStructures.EarlyExit"

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ phpstan.neon
77
infection.log
88
infection.html
99
.phpbench/
10+
docs_php/

‎Makefile‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,27 @@ benchmark-diff-test: vendor
4444
vendor/bin/phpbench run tests/Benchmark --revs=1 --report=diff --progress=none --ref=base
4545

4646

47+
.PHONY: docs
48+
docs: docs-extract-php docs-php-lint docs-phpcs docs-inject-php ## check and format docs code
49+
50+
.PHONY: docs-extract-php
51+
docs-extract-php: vendor
52+
bin/docs-extract-php-code
53+
54+
.PHONY: docs-inject-php
55+
docs-inject-php: vendor
56+
bin/docs-inject-php-code
57+
58+
.PHONY: docs-format
59+
docs-format: docs-phpcs docs-inject-php ## format docs
60+
61+
.PHONY: docs-php-lint
62+
docs-php-lint: docs-extract-php ## lint docs code
63+
php -l docs_php/*.php | grep -E 'Parse error|Fatal error' || true
64+
65+
.PHONY: docs-phpcs
66+
docs-phpcs: docs-extract-php
67+
vendor/bin/phpcbf docs_php --exclude=SlevomatCodingStandard.TypeHints.DeclareStrictTypes,SlevomatCodingStandard.ControlStructures.EarlyExit || true
68+
4769
.PHONY: dev
4870
dev: static test ## run dev tools

0 commit comments

Comments
 (0)