Skip to content

Commit a541c74

Browse files
authored
Update workflow to included PHP8.4 and use MariaDB 10.6 (#73)
* Update workflow * Update workflow * Updating workflows * Add the development component * Script Permissions * Script Permissions * Fix php-cs-fixer issues
1 parent dc75cc3 commit a541c74

2 files changed

Lines changed: 25 additions & 11 deletions

File tree

.github/workflows/plugin-ci-workflow.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ jobs:
3838
strategy:
3939
fail-fast: false
4040
matrix:
41-
php: ['8.1', '8.2', '8.3']
41+
php: ['8.1', '8.2', '8.3', '8.4']
4242
os: [ubuntu-latest]
4343

4444
services:
45-
mysql:
46-
image: mysql:8.0
45+
mariadb:
46+
image: mariadb:10.6
4747
env:
4848
MYSQL_ROOT_PASSWORD: cactiroot
4949
MYSQL_DATABASE: cacti
@@ -81,7 +81,6 @@ jobs:
8181
- name: Check PHP version
8282
run: php -v
8383

84-
8584
- name: Run apt-get update
8685
run: sudo apt-get update
8786

@@ -129,7 +128,7 @@ jobs:
129128
run: |
130129
cd ${{ github.workspace }}/cacti
131130
if [ -f composer.json ]; then
132-
sudo composer install --prefer-dist --no-progress
131+
sudo composer install --dev --no-progress
133132
fi
134133
135134
- name: Create Cacti config.php
@@ -141,7 +140,6 @@ jobs:
141140
sed -r "s/'cactiuser'/'cactiuser'/g" > ${{ github.workspace }}/cacti/include/config.php
142141
sudo chmod 664 ${{ github.workspace }}/cacti/include/config.php
143142
144-
145143
- name: Configure Apache
146144
run: |
147145
cat << 'EOF' | sed 's#GITHUB_WORKSPACE#${{ github.workspace }}#g' > /tmp/cacti.conf
@@ -179,7 +177,25 @@ jobs:
179177
echo "Syntax errors found!"
180178
exit 1
181179
fi
182-
180+
181+
- name: Remove the plugins directory exclusion from the .phpstan.neon
182+
run: sed '/plugins/d' -i .phpstan.neon
183+
working-directory: ${{ github.workspace }}/cacti
184+
185+
- name: Mark composer scripts executable
186+
run: sudo chmod +x ${{ github.workspace }}/cacti/include/vendor/bin/*
187+
188+
- name: Run Linter on base code
189+
run: composer run-script lint ${{ github.workspace }}/cacti/plugins/servcheck
190+
working-directory: ${{ github.workspace }}/cacti
191+
192+
- name: Checking coding standards on base code
193+
run: composer run-script phpcsfixer ${{ github.workspace }}/cacti/plugins/servcheck
194+
working-directory: ${{ github.workspace }}/cacti
195+
196+
# - name: Run PHPStan at Level 6 on base code outside of Composer due to technical issues
197+
# run: ./include/vendor/bin/phpstan analyze --level 6 ${{ github.workspace }}/cacti/plugins/servcheck
198+
# working-directory: ${{ github.workspace }}/cacti
183199

184200
- name: Run Cacti Poller
185201
run: |
@@ -191,12 +207,10 @@ jobs:
191207
exit 1
192208
fi
193209
194-
195-
196210
- name: View Cacti Logs
197211
if: always()
198212
run: |
199213
if [ -f ${{ github.workspace }}/cacti/log/cacti.log ]; then
200214
echo "=== Cacti Log ==="
201215
sudo cat ${{ github.workspace }}/cacti/log/cacti.log
202-
fi
216+
fi

setup.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function plugin_servcheck_upgrade() {
7575
}
7676

7777
if (!db_column_exists('plugin_servcheck_test', 'external_id')) {
78-
db_add_column('plugin_servcheck_test', array('name' => 'external_id', 'type' => 'varchar(20)', 'NULL' => false, 'default' => '', 'after' => 'notes'));
78+
db_add_column('plugin_servcheck_test', ['name' => 'external_id', 'type' => 'varchar(20)', 'NULL' => false, 'default' => '', 'after' => 'notes']);
7979
}
8080

8181
// 0.3 contains a lot of changes. I tried to convert old data but for sure make a backup

0 commit comments

Comments
 (0)