Skip to content

Commit ef70c99

Browse files
committed
docs: Document reusable GitHub Action for validating MultiFlexi apps
1 parent ae00058 commit ef70c99

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

source/apps_development.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,39 @@ Testing Your Application
841841
842842
bin/your-command
843843
844+
Validating in CI with GitHub Actions
845+
-------------------------------------
846+
847+
Rather than hand-rolling a schema-download-and-validate script in every
848+
application repository, use the reusable composite action
849+
`VitexSoftware/validate-multiflexi-app <https://github.com/VitexSoftware/validate-multiflexi-app>`_.
850+
It installs ``multiflexi-cli`` from ``repo.multiflexi.eu`` and runs
851+
``multiflexi-cli application:validate-json`` against your app definition
852+
files, using the schema bundled with ``php-vitexsoftware-multiflexi-core``
853+
instead of fetching a schema URL at validation time:
854+
855+
.. code-block:: yaml
856+
857+
name: MultiFlexi JSON Validation
858+
859+
on:
860+
push:
861+
paths:
862+
- 'multiflexi/*.json'
863+
pull_request:
864+
paths:
865+
- 'multiflexi/*.json'
866+
867+
jobs:
868+
validate-multiflexi-json:
869+
runs-on: ubuntu-latest
870+
steps:
871+
- uses: actions/checkout@v7
872+
- uses: VitexSoftware/validate-multiflexi-app@v1
873+
874+
The action accepts a ``path-glob`` input (default ``multiflexi/*.json``) if
875+
your app definitions live elsewhere. See the action's README for all inputs.
876+
844877
Deployment
845878
==========
846879

@@ -916,3 +949,4 @@ Resources
916949
* Report Schema: https://raw.githubusercontent.com/VitexSoftware/php-vitexsoftware-multiflexi-core/refs/heads/main/schema/report.json
917950
* Example applications: https://github.com/VitexSoftware, https://github.com/Spoje-NET
918951
* MultiFlexi CLI: Required version 2.2.0 or newer
952+
* CI validation action: https://github.com/VitexSoftware/validate-multiflexi-app

source/development/contributing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ MultiFlexi enforces JSON schema validation for application definitions to ensure
237237
* **Array vs Object**: Fields like ``topics``, ``requirements``, and ``artifacts`` must be arrays, not objects
238238
* **Missing required fields**: All required fields in the schema must be present
239239

240+
**Automating validation in CI**: application repositories should validate
241+
their ``multiflexi/*.json`` files on every push using the reusable action
242+
`VitexSoftware/validate-multiflexi-app <https://github.com/VitexSoftware/validate-multiflexi-app>`_,
243+
which wraps ``multiflexi-cli application:validate-json`` against the schema
244+
bundled with ``php-vitexsoftware-multiflexi-core`` (no schema URL fetch at
245+
validation time). See :ref:`application-development` /
246+
:doc:`../apps_development` for a sample workflow.
247+
240248
**Example of correct environment variable definition**:
241249

242250
.. code-block:: json

0 commit comments

Comments
 (0)