Skip to content

Commit

Permalink
Merge pull request #135 from jrfnl/feature/ghactions-fix-it
Browse files Browse the repository at this point in the history
GH Actions: fix the workflows
  • Loading branch information
paragonie-security committed Aug 8, 2021
2 parents c5911e1 + 6c0a37d commit 4ca89f2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 52 deletions.
76 changes: 24 additions & 52 deletions .github/workflows/ci.yml
Expand Up @@ -7,10 +7,10 @@ jobs:
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
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,54 +20,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: max_execution_time=600, memory_limit=256M, 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 }}
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']

- name: Install dependencies
run: composer install
continue-on-error: ${{ matrix.php-versions == '8.1' }}

- name: PHPUnit tests
uses: php-actions/phpunit@v2
timeout-minutes: 30
with:
memory_limit: 256M

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 @@ -77,20 +51,18 @@ 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 }}
ini-values: error_reporting=-1, display_errors=On
coverage: none

- name: Install dependencies
run: composer install
- name: Install Composer dependencies (PHP < 8.1)
if: ${{ matrix.php-versions != '8.1' }}
uses: "ramsey/composer-install@v1"

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

- name: Install Psalm
run: composer require --dev vimeo/psalm:^4; cp psalm-above-3.xml psalm.xml

- name: Static Analysis
run: vendor/bin/psalm
- name: PHPUnit tests
run: vendor/bin/phpunit
33 changes: 33 additions & 0 deletions .github/workflows/psalm.yml
@@ -0,0 +1,33 @@
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: Put Psalm config in place
run: cp psalm-above-3.xml psalm.xml

- name: Static Analysis
run: psalm

0 comments on commit 4ca89f2

Please sign in to comment.