Skip to content

Commit

Permalink
Run CI with a matrix of PHP versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruner committed Jan 25, 2023
1 parent 996c3c8 commit 54b21bc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,37 @@ name: CI
on: [push, pull_request]
jobs:
CI:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
image: zammad/zammad-ci:latest
services:
postgresql:
image: postgres:10
image: postgres:14
env:
POSTGRES_USER: zammad
POSTGRES_PASSWORD: zammad
env:
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_URL: "http://localhost:3000"
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_USERNAME: "admin@example.com"
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_PASSWORD: "test"
strategy:
fail-fast: false
matrix:
php: ['7.4', '7.3', '7.2', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- name: Set up PHP
- name: Install PHP
uses: shivammathur/setup-php@v2
env:
fail-fast: true
with:
php-version: ${{ matrix.php }}
- name: Report PHP version
run: php -v
- name: Install dependencies
shell: bash
run: |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin
ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
composer install
- name: Set up Zammad
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"guzzlehttp/guzzle": "^7"
},
"require-dev": {
"phpunit/phpunit": ">=5.7 <8"
"phpunit/phpunit": ">=5.7 <9"
},
"autoload": {
"psr-4": {"ZammadAPIClient\\": "src/"}
Expand Down
2 changes: 1 addition & 1 deletion test/ZammadAPIClient/Resource/AbstractBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ abstract class AbstractBaseTest extends TestCase
protected $update_field;
protected static $unique_id;

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
$client_config = [
# Set a high timeout for tests to work with slow CI.
Expand Down
6 changes: 3 additions & 3 deletions test/ZammadAPIClient/Resource/TagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class TagTest extends TestCase

protected $resource_type = ResourceType::TAG;

public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
$client_config = [];

Expand All @@ -34,13 +34,13 @@ public static function setUpBeforeClass()
self::$client = new Client($client_config);
}

public function setUp()
public function setUp(): void
{
parent::setUp();
self::createTicket();
}

public function tearDown()
public function tearDown(): void
{
parent::tearDown();
self::deleteTicket();
Expand Down

0 comments on commit 54b21bc

Please sign in to comment.