Skip to content

Allow phpunit 10

Allow phpunit 10 #285

Workflow file for this run

name: Build
on:
push:
branches: [main, next, master, 2.5, 3.4, 4.3, 5.1, 6.3]
pull_request:
release:
types: [created]
jobs:
tests:
runs-on: ubuntu-latest
name: Build and test
strategy:
fail-fast: false
matrix:
php: ["7.3", "7.4", "8.0", "8.1", "8.2"]
operating-system: [ ubuntu-latest, macOS-latest, windows-latest ]
composer-flags: [""]
composer-extras: [""]
stability: ["stable"]
include:
- php: "7.3"
publish-phar: true
- php: "7.3"
composer-flags: --prefer-lowest
- php: "7.3"
composer-extras: "symfony/event-dispatcher ^3.4 symfony/contracts ^2.0"
- php: "8.0"
operating-system: windows-latest
- php: "8.2"
stability: "dev"
env:
COMPOSER_ROOT_VERSION: dev-master
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
ini-values: "phar.readonly=0"
- name: Install composer extras
if: matrix.composer-extras != ''
run: composer require ${{ matrix.composer-extras }} --no-update
- name: Update the minimum stability
if: matrix.stability == 'dev'
run: composer config minimum-stability ${{ matrix.stability }}
- name: Locate composer cache
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v2
env:
cache-name: cache-composer
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ hashFiles('composer.json') }}
- name: Install composer dependencies
run: composer update ${{ matrix.composer-flags }}
- name: Run static analysis (psalm)
if: matrix.composer-flags != '--prefer-lowest'
run: ./vendor/bin/psalm --php-version=${{ matrix.php }}
- name: Run tests (phpspec)
run: bin/phpspec run --format=dot
- name: Run tests (phpunit)
run: ./vendor/bin/phpunit -v
- name: Run tests (behat)
if: matrix.php != '8.0' && matrix.php != '8.1' && matrix.php != '8.2'
run: ./vendor/bin/behat --format=progress --tags="~@php8"
- name: Run tests (behat)
if: matrix.php == '8.0' || matrix.php == '8.1' || matrix.php == '8.2'
run: ./vendor/bin/behat --format=progress
- name: Build the PHAR
if: matrix.php != '8.0' && matrix.php != '8.1' && matrix.php != '8.2'
run: |
composer config platform.php 7.3.0 &&
ln -s `which composer` composer.phar &&
make phpspec.phar
- uses: actions/upload-artifact@v1
name: Publish the PHAR
if: matrix.publish-phar
with:
name: phpspec.phar
path: phpspec.phar
publish-phar:
runs-on: ubuntu-latest
name: Publish the PHAR
needs: tests
if: github.event_name == 'release'
steps:
- uses: actions/download-artifact@v1
with:
name: phpspec.phar
path: .
- name: Upload phpspec.phar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: phpspec.phar
asset_name: phpspec.phar
asset_content_type: application/zip