mirror of
https://github.com/Cacti/cacti.git
synced 2026-12-06 07:05:31 +09:00
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Syntax Checker
|
|
|
|
on:
|
|
push:
|
|
branches: [ 1.2.x, develop ]
|
|
pull_request:
|
|
branches: [ 1.2.x, develop ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest] #ubuntu-16.04
|
|
php: ['5.4','7.0','7.4'] # 8.0 / 8.1 not yet fully supported
|
|
|
|
services:
|
|
mysql:
|
|
image: mysql:latest
|
|
env:
|
|
MYSQL_DATABASE: cacti
|
|
MYSQL_HOST: 127.0.0.1
|
|
MYSQL_USER: cactiuser
|
|
MYSQL_PASSWORD: cactiuser
|
|
MYSQL_ROOT_PASSWORD: cactiroot
|
|
ports:
|
|
- 3306:3306
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
|
|
name: PHP ${{ matrix.php }} Test on ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install PHP ${{ matrix.php }}
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
extensions: intl mysql gd ldap gmp xml mbstring #optional
|
|
ini-values: "post_max_size=256M" #optional
|
|
|
|
- name: Check PHP version
|
|
run: php -v
|
|
|
|
- name: Check PHP syntax
|
|
run: if find ${{ github.workspace }} -name '*.php' -exec php -l {} 2>&1 \; | grep -iv 'no syntax errors detected'; then exit 1; fi
|
|
|
|
- name: Set open permissions for testing purposes
|
|
run: sudo chmod -R 777 ${{ github.workspace}}
|
|
|
|
- name: Check install code
|
|
run: |
|
|
cd ${{ github.workspace }}
|
|
sudo php -q tests/tools/check_install_code.php
|