fix: harden Mactrack release boundaries #8
Workflow file for this run
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
| # +-------------------------------------------------------------------------+ | |
| # | Copyright (C) 2004-2026 The Cacti Group | | |
| # | | | |
| # | This program is free software; you can redistribute it and/or | | |
| # | modify it under the terms of the GNU General Public License | | |
| # | as published by the Free Software Foundation; either version 2 | | |
| # | of the License, or (at your option) any later version. | | |
| # +-------------------------------------------------------------------------+ | |
| # | Cacti: The Complete RRDtool-based Graphing Solution | | |
| # +-------------------------------------------------------------------------+ | |
| name: Code Quality | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| name: PHP Lint (PHP ${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.1', '8.2', '8.3', '8.4'] | |
| steps: | |
| - name: Checkout plugin | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Install PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| # Lint only the plugin's own PHP. Vendored code (Net/, vendor/) is pruned | |
| # so third-party sources never gate the plugin. | |
| - name: Lint plugin PHP | |
| run: | | |
| find . -path ./.git -prune \ | |
| -o -path ./Net -prune \ | |
| -o -path ./vendor -prune \ | |
| -o -name '*.php' -print0 \ | |
| | xargs -0 -n1 -P4 php -l | |
| phpstan: | |
| name: PHPStan level 6 (PHP ${{ matrix.php }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.1', '8.2', '8.3', '8.4'] | |
| steps: | |
| - name: Checkout Cacti core | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| repository: Cacti/cacti | |
| ref: release/1.2.31 | |
| path: cacti | |
| - name: Checkout plugin | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| path: cacti/plugins/mactrack | |
| - name: Install PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| coverage: none | |
| tools: composer:v2, phpstan | |
| # Cacti core ships an incomplete vendor tree; its bootstrap needs the | |
| # runtime dependencies installed so core functions resolve for PHPStan. | |
| - name: Install Cacti core dependencies | |
| working-directory: cacti | |
| run: composer install --no-dev --no-interaction --no-progress | |
| # release/1.2.31 does not ship .phpstan-bootstrap.php (develop does). | |
| # Provide a no-op stub so the plugin config can load either core tree. | |
| - name: Ensure PHPStan bootstrap exists | |
| working-directory: cacti | |
| run: | | |
| if [ ! -f .phpstan-bootstrap.php ]; then | |
| printf '%s\n' '<?php' '// Stub bootstrap for Cacti trees without a core PHPStan entrypoint' > .phpstan-bootstrap.php | |
| fi | |
| # Analysis runs against the plugin's own code only; the config excludes | |
| # Net/ and vendor/. The committed baseline pins the accepted findings. | |
| - name: Run PHPStan | |
| working-directory: cacti/plugins/mactrack | |
| run: phpstan analyse --configuration=.phpstan.neon --no-progress --memory-limit=2G |