diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index bdbd889..a9db8d3 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -85,7 +85,7 @@ jobs: run: sudo apt-get update - name: Install System Dependencies - run: sudo apt-get install -y apache2 snmp snmpd rrdtool fping libapache2-mod-php${{ matrix.php }} + run: sudo apt-get install -y apache2 snmp snmpd rrdtool fping - name: Start SNMPD Agent and Test run: | @@ -164,7 +164,14 @@ jobs: run: | cd ${{ github.workspace }}/cacti sudo php cli/install_cacti.php --accept-eula --install --force - + + - name: Install Mactrack Composer Dependencies + run: | + cd ${{ github.workspace }}/cacti/plugins/mactrack + if [ -f composer.json ]; then + sudo composer install --no-dev --prefer-dist --no-progress --no-interaction + fi + - name: Install mactrack Plugin run: | cd ${{ github.workspace }}/cacti @@ -182,10 +189,8 @@ jobs: - name: Check PHP Syntax for Plugin run: | cd ${{ github.workspace }}/cacti/plugins/mactrack - if find . -name '*.php' -exec php -l {} 2>&1 \; | grep -iv 'no syntax errors detected'; then - echo "Syntax errors found!" - exit 1 - fi + set -o pipefail + find . -path './vendor' -prune -o -type f -name '*.php' -print0 | xargs -0 -r -n1 php -l - name: Remove the plugins directory exclusion from the .phpstan.neon run: sed '/plugins/d' -i .phpstan.neon