Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Actions: run tests against PHP 8.1 and other tweaks #172

Merged
merged 8 commits into from Aug 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
82 changes: 25 additions & 57 deletions .github/workflows/ci.yml
Expand Up @@ -8,9 +8,8 @@ jobs:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-16.04']
operating-system: ['ubuntu-18.04']
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0']
phpunit-versions: ['7.5.20']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -20,57 +19,28 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
tools: psalm, phpunit:${{ matrix.phpunit-versions }}
ini-values: error_reporting=-1, display_errors=On
coverage: none

- name: Install dependencies
run: composer self-update --1; composer install
- name: Use Composer 1.x
run: composer self-update --1

- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: PHPUnit tests
uses: php-actions/phpunit@v2
with:
memory_limit: 256M
run: vendor/bin/phpunit

moderate:
moderate-modern:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.1', '7.2', '7.3']
phpunit-versions: ['latest']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sodium
ini-values: post_max_size=256M, max_execution_time=180
tools: psalm, phpunit:${{ matrix.phpunit-versions }}

- name: Install dependencies
run: composer install

- name: Modernize dependencies
run: composer require --dev "phpunit/phpunit:>=4"
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']

- name: PHPUnit tests
uses: php-actions/phpunit@v2
timeout-minutes: 30
with:
memory_limit: 256M
continue-on-error: ${{ matrix.php-versions == '8.1' }}

modern:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.4', '8.0']
phpunit-versions: ['latest']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -80,23 +50,21 @@ jobs:
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, sodium
ini-values: post_max_size=256M, max_execution_time=180
tools: psalm, phpunit:${{ matrix.phpunit-versions }}

- name: Install dependencies
run: composer install
ini-values: error_reporting=-1, display_errors=On
coverage: none

- name: Modernize dependencies
run: composer require --dev "phpunit/phpunit:>=4"
run: composer require --dev --no-update "phpunit/phpunit:>=4"

- name: PHPUnit tests
uses: php-actions/phpunit@v2
timeout-minutes: 30
with:
memory_limit: 256M
- name: Install Composer dependencies (PHP < 8.1)
if: ${{ matrix.php-versions != '8.1' }}
uses: "ramsey/composer-install@v1"

- name: Install Psalm
run: rm composer.lock && composer require --dev vimeo/psalm:^4
- name: Install Composer dependencies - ignore-platform-reqs (PHP 8.1)
if: ${{ matrix.php-versions == '8.1' }}
uses: "ramsey/composer-install@v1"
with:
composer-options: --ignore-platform-reqs

- name: Static Analysis
run: vendor/bin/psalm
- name: PHPUnit tests
run: vendor/bin/phpunit
30 changes: 30 additions & 0 deletions .github/workflows/psalm.yml
@@ -0,0 +1,30 @@
name: Psalm

on: [push]

jobs:
psalm:
name: Psalm on PHP ${{ matrix.php-versions }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions: ['7.4']
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: psalm:4
coverage: none

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

- name: Static Analysis
run: psalm