Skip to content

Commit 3ddc7b7

Browse files
committed
GH Actions: add some additional XML validation checks
* Check the docs against the schema from PHPCSDevTools. * Check dev tool config files.
1 parent 750ff5a commit 3ddc7b7

File tree

3 files changed

+115
-1
lines changed

3 files changed

+115
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
NOTES:
2+
3+
Check how they do it in....
4+
* PHPUnit
5+
* PHPDocumentor
6+
* PHPStan
7+
8+
* Still also needs the (slimmed down) release checklist for the manual steps
9+
10+
* basic principle: trigger a release build on closing a milestone.
11+
!!! ONLY RUN on this repo!!!
12+
-> see if any of the "prelim" tasks can be automated (like checking for squizlabs `@license` tag)
13+
- create a tag
14+
- create the phars
15+
- run the tests
16+
- sign the PHAR files
17+
-> will need to figure out if this step will fail (correctly) if the signature needs renewal. If not, will need a check before this to check if the signature is still valid
18+
- attest the signatures too ?
19+
- verify PHAR attestations
20+
- create the GH Pages update
21+
-> will probably need a script to update the phive.xml file
22+
- commit & build GH Pages
23+
- verify the site has been updated
24+
- download phar file and check phpcs -v against tag
25+
- do test install with phive and verify installed versions
26+
- create a draft release for the tag and upload the phar + asc files to it
27+
- ??? can probably not do the update of the version nr to next as doesn't know what the "next" version should be...
28+
29+
30+
* will need a think about if and if so, how the PHAR building job can be made re-usable
31+
* will need a think about whether `test` should still run on `tag` as if the tag is created by a workflow, I highly doubt it will trigger a run
32+
=> and if so, may need to have a think about making the test workflow reusable too, including whether this can be set up to handle code coverage in the same re-usable workflow
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
Workflow - things to think through:
2+
3+
* Release vs pre-release
4+
5+
* On release vs manually triggered
6+
7+
=> The `latest` tag determination is probably not necessary when running on "release".
8+
Info should be available in the `github` context -> needs checking
9+
If so, those steps could be made conditional on "workflow triggered".
10+
11+
=> For pre-release, we need to skip the `verify-plain-web` job as that should always hold the latest release, not pre-release
12+
The other jobs should still run.
13+
14+
=> For workflow triggered....
15+
-> We need to check if the latest release is a release or pre-release.
16+
If release, all good, continue as normal.
17+
If pre-release, the plain web check needs to be skipped ?
18+
Or should it try and find the latest _stable_ release and try and verify that instead ?
19+
20+
------------
21+
22+
=> See about moving the "determine the tag" part to a separate job and carrying a variable over to the next jobs
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
=================================================================================
34+
35+
NOTES:
36+
37+
Check how they do it in....
38+
* PHPUnit
39+
* PHPDocumentor
40+
* PHPStan
41+
42+
* Still also needs the (slimmed down) release checklist for the manual steps
43+
44+
* basic principle: trigger a release build on closing a milestone.
45+
!!! ONLY RUN on this repo!!!
46+
-> see if any of the "prelim" tasks can be automated (like checking for squizlabs `@license` tag)
47+
- create a tag
48+
- create the phars
49+
- run the tests
50+
- sign the PHAR files
51+
-> will need to figure out if this step will fail (correctly) if the signature needs renewal. If not, will need a check before this to check if the signature is still valid
52+
- attest the signatures too ?
53+
- verify PHAR attestations
54+
- create the GH Pages update
55+
-> will probably need a script to update the phive.xml file
56+
- commit & build GH Pages
57+
- verify the site has been updated
58+
- download phar file and check phpcs -v against tag
59+
- do test install with phive and verify installed versions
60+
- create a draft release for the tag and upload the phar + asc files to it
61+
- ??? can probably not do the update of the version nr to next as doesn't know what the "next" version should be...
62+
63+
64+
* will need a think about if and if so, how the PHAR building job can be made re-usable
65+
* will need a think about whether `test` should still run on `tag` as if the tag is created by a workflow, I highly doubt it will trigger a run
66+
=> and if so, may need to have a think about making the test workflow reusable too, including whether this can be set up to handle code coverage in the same re-usable workflow
67+
68+

.github/workflows/validate.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,24 @@ jobs:
4242
pattern: "./src/Standards/*/ruleset.xml"
4343
xsd-file: "phpcs.xsd"
4444

45-
# Validate the basic well-formedness of the Documentation XML files.
45+
# Validate the Documentation XML files.
4646
- name: Validate documentation XML
4747
uses: phpcsstandards/xmllint-validate@v1
4848
with:
4949
pattern: "./src/Standards/*/Docs/*/*Standard.xml"
50+
xsd-url: "https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
51+
52+
# Validate dev tool related XML files.
53+
- name: Validate Project PHPCS ruleset against schema
54+
uses: phpcsstandards/xmllint-validate@v1
55+
with:
56+
pattern: "phpcs.xml.dist"
57+
xsd-file: "phpcs.xsd"
58+
59+
- name: "Validate PHPUnit config for well-formedness"
60+
uses: phpcsstandards/xmllint-validate@v1
61+
with:
62+
pattern: "phpunit.xml.dist"
5063

5164
xml-cs:
5265
name: 'XML Code style'
@@ -80,6 +93,7 @@ jobs:
8093
- name: Check XML code style
8194
run: |
8295
diff -B ./phpcs.xml.dist <(xmllint --format "./phpcs.xml.dist")
96+
diff -B ./phpunit.xml.dist <(xmllint --format "./phpunit.xml.dist")
8397
diff -B ./src/Standards/Generic/ruleset.xml <(xmllint --format "./src/Standards/Generic/ruleset.xml")
8498
diff -B ./src/Standards/MySource/ruleset.xml <(xmllint --format "./src/Standards/MySource/ruleset.xml")
8599
diff -B ./src/Standards/PEAR/ruleset.xml <(xmllint --format "./src/Standards/PEAR/ruleset.xml")

0 commit comments

Comments
 (0)