diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..978cc4d --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,49 @@ +name: "Documentation" + +on: + pull_request: + branches: + - "*.*" + - "main" + paths: + - .github/workflows/documentation.yml + - docs/** + push: + branches: + - "*.*" + - "main" + paths: + - .github/workflows/documentation.yml + - docs/** + +jobs: + validate-with-guides: + name: "Validate documentation with phpDocumentor/guides" + runs-on: "ubuntu-22.04" + + steps: + - name: "Checkout code" + uses: "actions/checkout@v3" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "8.2" + + - name: "Remove existing composer file" + run: "rm composer.json" + + - name: "Require phpdocumentor/guides-cli" + run: "composer require --dev phpdocumentor/guides-cli dev-main@dev --no-update" + + - name: "Configure minimum stability" + run: "composer config minimum-stability dev" + + - name: "Install dependencies with Composer" + uses: "ramsey/composer-install@v2" + with: + dependency-versions: "highest" + + - name: "Run guides-cli" + run: "vendor/bin/guides -vvv --no-progress --fail-on-log Documentation /tmp/test "