Skip to content

Commit

Permalink
Merge pull request #172 from jrfnl/feature/ghactions-fix-it
Browse files Browse the repository at this point in the history
GH Actions: run tests against PHP 8.1 and other tweaks
  • Loading branch information
paragonie-security committed Aug 8, 2021
2 parents 0f1f602 + 8100036 commit 73f1f02
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 57 deletions.
82 changes: 25 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 73f1f02

Please sign in to comment.