docs: render Mermaid diagrams on Read the Docs #6122
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "phpMyFAQ Build" | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| checks: write | |
| jobs: | |
| run: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| operating-system: ['ubuntu-latest'] | |
| php-versions: ['8.4', '8.5', '8.6'] | |
| name: phpMyFAQ ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7.0.0 | |
| - name: Setup PHP, with composer and extensions | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| extensions: mbstring, curl, fileinfo, filter, gd, json, zip, xml, sqlite3, xdebug, pcov | |
| coverage: xdebug | |
| - name: Get composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache composer dependencies | |
| uses: actions/cache@v5.0.5 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install PHP dependencies | |
| run: composer install --no-progress --prefer-dist --optimize-autoloader | |
| - name: Setup Mago CLI | |
| uses: nhedger/setup-mago@v2 | |
| - name: Run Mago | |
| run: | | |
| mago format --dry-run | |
| # mago lint --reporting-format=github | |
| # mago analyze --reporting-format=github | |
| - name: Check version consistency | |
| run: php scripts/check-version.php | |
| - name: Test with PHPUnit | |
| run: phpmyfaq/src/libs/bin/phpunit --coverage-text --log-junit junit.xml | |
| - name: Publish PHPUnit test results | |
| uses: mikepenz/action-junit-report@v6.4.1 | |
| if: always() | |
| with: | |
| report_paths: junit.xml | |
| check_name: PHPUnit Test Results (PHP ${{ matrix.php-versions }}) | |
| detailed_summary: true | |
| include_passed: true | |
| - name: Setup Node.js with pnpm | |
| uses: actions/setup-node@v6 | |
| with: | |
| package-manager-cache: false | |
| node-version: 24 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6.0.9 | |
| with: | |
| version: 8.15.5 | |
| run_install: false | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v5.0.5 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install Node.js dependencies | |
| run: pnpm install | |
| - name: Run oxfmt format check | |
| run: pnpm run oxfmt | |
| - name: Run oxlint check | |
| run: pnpm run oxlint | |
| - name: Run Stylelint check | |
| run: pnpm run stylelint | |
| - name: Run Vitest tests | |
| run: pnpm test |