PHP #2858
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- "v**" | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 9,14,17 * * *' | |
jobs: | |
code-quality: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
dependencies: | |
- lowest | |
- highest | |
php-version: | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: pcov | |
php-version: ${{ matrix.php-version }} | |
ini-values: memory_limit=-1 | |
env: | |
update: true | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.composer/cache | |
vendor | |
key: php-${{ matrix.php-version }}-${{ matrix.dependencies }} | |
- name: Install lowest dependencies | |
if: ${{ matrix.dependencies == 'lowest' }} | |
run: composer update --prefer-lowest --no-interaction --no-progress | |
- name: Install highest dependencies | |
if: ${{ matrix.dependencies == 'highest' }} | |
run: composer update --no-interaction --no-progress | |
- name: PHPStan | |
run: composer analyse | |
- name: Integration Tests | |
run: composer integration-tests | |
- name: Setup Acceptance Tests | |
run: | | |
touch .env | |
echo TEST_CLIENT_ID=${{ secrets.TEST_CLIENT_ID }} >> .env | |
echo TEST_CLIENT_SECRET=${{ secrets.TEST_CLIENT_SECRET }} >> .env | |
echo TEST_KID=${{ secrets.TEST_KID }} >> .env | |
echo TEST_PEM=${{ secrets.TEST_PEM }} >> .env | |
- name: Run Acceptance Tests | |
run: composer acceptance-tests | |
- name: Test HTTP Clients | |
run: | | |
composer require symfony/http-client --dev | |
composer remove guzzlehttp/guzzle --dev | |
composer run acceptance-tests -- --filter "retrieves merchant accounts" | |
composer require php-http/curl-client --dev | |
composer remove guzzlehttp/guzzle --dev | |
composer run acceptance-tests -- --filter "retrieves merchant accounts" |