Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move remaining CI tasks to Github Actions
Browse files Browse the repository at this point in the history
phansys committed May 25, 2021
1 parent 54434dc commit 7086ee9
Showing 4 changed files with 91 additions and 126 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -3,6 +3,20 @@ on: [push, pull_request]
name: Lint

jobs:
php-cs-fixer:
name: PHP-CS-Fixer

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Run PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga:2.18.5
with:
args: --ansi --verbose --diff --dry-run

composer-normalize:
name: composer-normalize

74 changes: 74 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Test

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: PHP ${{ matrix.php-version }} + Zabbix ${{ matrix.zabbix-version }}

runs-on: ubuntu-latest

continue-on-error: ${{ matrix.allowed-to-fail }}

strategy:
matrix:
php-version:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
allowed-to-fail: [false]
zabbix-version:
- '3.0.0'
- '3.0.32'
- '3.2.0'
- '3.2.11'
- '3.4.0'
- '3.4.15'
- '4.0.0'
- '4.4.0'
include:
- php-version: '5.3'
zabbix-version: '2.4.0'
allowed-to-fail: false
- php-version: '5.3'
zabbix-version: '2.4.8'
allowed-to-fail: false

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Get Zabbix source
run: |
mkdir -p /opt/zabbix
wget -qO- https://repo.zabbix.com/zabbix/$(echo ${{ matrix.zabbix-version }} | cut -d. -f-2)/ubuntu/pool/main/z/zabbix/zabbix_${{ matrix.zabbix-version }}.orig.tar.gz | tar xvz -C /opt/zabbix
ln -s /opt/zabbix/zabbix-${{ matrix.zabbix-version }}/frontends/php/ /opt/zabbix/frontend
- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2

- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v1"
with:
composer-options: "--prefer-dist"

- name: Build
run: build/build.php

- name: Run Tests
run: vendor/bin/phpunit
123 changes: 0 additions & 123 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions build/build.php
Original file line number Diff line number Diff line change
@@ -26,8 +26,8 @@
* @author confirm IT solutions GmbH, Rathausstrase 14, CH-6340 Baar
*/

if (!in_array(PHP_SAPI, array('cli', 'phpdbg', 'embed'), true)) {
throw new RuntimeException('Error: '.__FILE__.' must be invoked via the CLI version of PHP, not the '.PHP_SAPI.' SAPI'.PHP_EOL);
if (!in_array(\PHP_SAPI, array('cli', 'phpdbg', 'embed'), true)) {
throw new RuntimeException('Error: '.__FILE__.' must be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL);
}

set_time_limit(0);
@@ -208,7 +208,7 @@ function __autoload($className)

foreach ($constantsArray['constant_names'] as $declaredName) {
if (false !== strpos($value, $declaredName)) {
if (version_compare(PHP_VERSION, '5.6') >= 0) {
if (version_compare(\PHP_VERSION, '5.6') >= 0) {
$declaredNameValue = 'self::'.$declaredName;
$value = preg_replace('#\b'.$declaredName.'\b#', $declaredNameValue, $value);
} elseif (false !== $declaredNameKey = array_search($declaredName, $constantsArray['constant_names'], true)) {

0 comments on commit 7086ee9

Please sign in to comment.