diff --git a/.github/workflows/plugin-ci-workflow.yml b/.github/workflows/plugin-ci-workflow.yml index 5d553d6..cb0715d 100644 --- a/.github/workflows/plugin-ci-workflow.yml +++ b/.github/workflows/plugin-ci-workflow.yml @@ -38,12 +38,12 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1', '8.2', '8.3'] + php: ['8.1', '8.2', '8.3', '8.4'] os: [ubuntu-latest] services: - mysql: - image: mysql:8.0 + mariadb: + image: mariadb:10.6 env: MYSQL_ROOT_PASSWORD: cactiroot MYSQL_DATABASE: cacti @@ -81,7 +81,6 @@ jobs: - name: Check PHP version run: php -v - - name: Run apt-get update run: sudo apt-get update @@ -129,7 +128,7 @@ jobs: run: | cd ${{ github.workspace }}/cacti if [ -f composer.json ]; then - sudo composer install --prefer-dist --no-progress + sudo composer install --dev --no-progress fi - name: Create Cacti config.php @@ -141,7 +140,6 @@ jobs: sed -r "s/'cactiuser'/'cactiuser'/g" > ${{ github.workspace }}/cacti/include/config.php sudo chmod 664 ${{ github.workspace }}/cacti/include/config.php - - name: Configure Apache run: | cat << 'EOF' | sed 's#GITHUB_WORKSPACE#${{ github.workspace }}#g' > /tmp/cacti.conf @@ -179,7 +177,25 @@ jobs: echo "Syntax errors found!" exit 1 fi - + + - name: Remove the plugins directory exclusion from the .phpstan.neon + run: sed '/plugins/d' -i .phpstan.neon + working-directory: ${{ github.workspace }}/cacti + + - name: Mark composer scripts executable + run: sudo chmod +x ${{ github.workspace }}/cacti/include/vendor/bin/* + + - name: Run Linter on base code + run: composer run-script lint ${{ github.workspace }}/cacti/plugins/servcheck + working-directory: ${{ github.workspace }}/cacti + + - name: Checking coding standards on base code + run: composer run-script phpcsfixer ${{ github.workspace }}/cacti/plugins/servcheck + working-directory: ${{ github.workspace }}/cacti + +# - name: Run PHPStan at Level 6 on base code outside of Composer due to technical issues +# run: ./include/vendor/bin/phpstan analyze --level 6 ${{ github.workspace }}/cacti/plugins/servcheck +# working-directory: ${{ github.workspace }}/cacti - name: Run Cacti Poller run: | @@ -191,12 +207,10 @@ jobs: exit 1 fi - - - name: View Cacti Logs if: always() run: | if [ -f ${{ github.workspace }}/cacti/log/cacti.log ]; then echo "=== Cacti Log ===" sudo cat ${{ github.workspace }}/cacti/log/cacti.log - fi \ No newline at end of file + fi diff --git a/setup.php b/setup.php index d58ae71..ebd00b5 100644 --- a/setup.php +++ b/setup.php @@ -75,7 +75,7 @@ function plugin_servcheck_upgrade() { } if (!db_column_exists('plugin_servcheck_test', 'external_id')) { - db_add_column('plugin_servcheck_test', array('name' => 'external_id', 'type' => 'varchar(20)', 'NULL' => false, 'default' => '', 'after' => 'notes')); + db_add_column('plugin_servcheck_test', ['name' => 'external_id', 'type' => 'varchar(20)', 'NULL' => false, 'default' => '', 'after' => 'notes']); } // 0.3 contains a lot of changes. I tried to convert old data but for sure make a backup