Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: PHPUnit

on:
push:
branches-ignore:
- 'analysis-**'

jobs:
phpunit:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
cmd: ['composer test']
coverage: [false]
include:
- php: '7.2'
flags: '--prefer-stable --prefer-lowest'
coverage: true
cmd: 'composer test-ci'
- php: '7.2'
flags: '--prefer-stable --prefer-lowest'

steps:
- name: Clone repository
uses: actions/checkout@v2.3.5

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@2.15.0
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: pcov

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer packages
uses: actions/cache@v2.1.6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-

- name: Install dependencies
run: composer update ${{ matrix.flags }} --prefer-source --no-interaction --ignore-platform-reqs

- name: Run test suite
run: |
vendor/bin/http_test_server > /dev/null 2>&1 &
cd ./tests/server/ssl && ./generate.sh && pwd && ls -la && cd ../../../
${{ matrix.cmd }}

- name: Upload coverage data
if: matrix.coverage == true
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.