From e1f0b459d80f776c1cc95b1607ce639fd39fdb52 Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 8 Oct 2024 14:18:11 -0400 Subject: [PATCH] Added PhpDoc generating to CI (test) --- .github/workflows/ncc_workflow.yml | 42 ++++++++++++++++++++++++++++++ phpdoc.dist.xml | 15 +++++++++++ 2 files changed, 57 insertions(+) create mode 100644 phpdoc.dist.xml diff --git a/.github/workflows/ncc_workflow.yml b/.github/workflows/ncc_workflow.yml index e705429..5dfa2e6 100644 --- a/.github/workflows/ncc_workflow.yml +++ b/.github/workflows/ncc_workflow.yml @@ -75,6 +75,48 @@ jobs: echo "phpunit-exists=false" >> $GITHUB_OUTPUT fi + check-phpdoc: + runs-on: ubuntu-latest + outputs: + phpdoc-exists: ${{ steps.check.outputs.phpdoc-exists }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check for phpdoc.xml + id: check + run: | + if [ -f phpdoc.xml ]; then + echo "phpdoc-exists=true" >> $GITHUB_OUTPUT + else + echo "phpdoc-exists=false" >> $GITHUB_OUTPUT + fi + + generate_phpdoc: + needs: [build, check-phpdoc] + runs-on: ubuntu-latest + container: + image: php:8.3 + if: needs.check-phpdoc.outputs.phpdoc-exists == 'true' + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download PHPDocumentor + run: | + wget https://phpdoc.org/phpDocumentor.phar + chmod +x phpDocumentor.phar + + - name: Generate PHPDoc + run: | + php phpDocumentor.phar -d src -t docs + + - name: Upload PHPDoc + uses: actions/upload-artifact@v4 + with: + name: phpdoc + path: docs + test: needs: [build, check-phpunit] runs-on: ubuntu-latest diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml new file mode 100644 index 0000000..9d8f0a2 --- /dev/null +++ b/phpdoc.dist.xml @@ -0,0 +1,15 @@ + + + + build/docs + build/cache + + + + + src/TgBotLib + + net.nosial.tgbotlib + + + \ No newline at end of file