Skip to content

Commit

Permalink
feat: support PHP 8 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
cawolf authored Dec 20, 2021
1 parent 01e90d5 commit 7a74fbf
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 158 deletions.
201 changes: 100 additions & 101 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,106 @@
name: test

on:
push:
branches:
- '*'
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- 'master'
schedule:
- cron: '1 9 * * 0'
push:
branches:
- '*'
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- 'master'
schedule:
- cron: '1 9 * * 0'

jobs:
test_unit:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: '7.3'
symfony: '3.4.*'
- php: '7.4'
symfony: '3.4.*'
- php: '7.3'
symfony: '4.4.*'
- php: '7.4'
symfony: '4.4.*'
- php: '7.3'
symfony: '5.3.*'
- php: '7.4'
symfony: '5.3.*'
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup php
uses: nanasess/setup-php@v3.0.6
with:
php-version: ${{ matrix.php }}
- name: prepare test environment
run: |
Tests/Functional/Scripts/downloadComposer.sh
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config extra.symfony.allow-contrib true
# adds flex, suppress composer.lock
composer require symfony/flex --no-update
# create a lock file
composer install
# updates to SYMFONY_VERSION, but runs recipes
composer update symfony/*
# reset tracked files
git reset --hard
# clean up recipe generated files and folders
git clean -df
- name: execute unit tests
run: composer run-script quality
- name: upload coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
test_unit:
name: Unit Tests
runs-on: ubuntu-latest
strategy:
matrix:
symfony:
- '3.4.*'
- '4.4.*'
- '5.3.*'
php:
- '7.4'
- '8.0'
- '8.1'
steps:
- name: checkout
uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: prepare test environment
run: |
Tests/Functional/Scripts/downloadComposer.sh
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config extra.symfony.allow-contrib true
# adds flex, suppress composer.lock
composer require symfony/flex --no-update
# create a lock file
composer install
# updates to SYMFONY_VERSION, but runs recipes
composer update symfony/*
# reset tracked files
git reset --hard
# clean up recipe generated files and folders
git clean -df
- name: execute unit tests
run: composer run-script quality
- name: upload coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls --exclude-no-stmt --coverage_clover=build/logs/clover.xml -v

test_functional:
name: Functional Tests
needs:
- test_unit
runs-on: ubuntu-latest
strategy:
matrix:
symfony:
- '3.4.*'
- '4.4.*'
- '5.3.*'
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup php
uses: nanasess/setup-php@v3.0.6
with:
php-version: '7.4'
- name: prepare test environment
run: |
Tests/Functional/Scripts/downloadComposer.sh
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config extra.symfony.allow-contrib true
# adds flex, suppress composer.lock
composer require symfony/flex --no-update
# create a lock file
composer install
# updates to SYMFONY_VERSION, but runs recipes
composer update symfony/*
# reset tracked files
git reset --hard
# clean up recipe generated files and folders
git clean -df
- name: install symfony cli
run: |
wget https://get.symfony.com/cli/installer -O - | bash
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
- name: execute functional tests
env:
SYMFONY_VERSION: ${{ matrix.symfony }}
run: composer run-script phpunit-functional
- name: show running containers
run: docker ps
test_functional:
name: Functional Tests
needs:
- test_unit
runs-on: ubuntu-latest
strategy:
matrix:
symfony:
- '3.4.*'
- '4.4.*'
- '5.3.*'
php:
- '7.4'
- '8.0'
- '8.1'
steps:
- name: checkout
uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: prepare test environment
run: |
Tests/Functional/Scripts/downloadComposer.sh
composer config extra.symfony.require "${{ matrix.symfony }}"
composer config extra.symfony.allow-contrib true
# adds flex, suppress composer.lock
composer require symfony/flex --no-update
# create a lock file
composer install
# updates to SYMFONY_VERSION, but runs recipes
composer update symfony/*
# reset tracked files
git reset --hard
# clean up recipe generated files and folders
git clean -df
- name: install symfony cli
run: |
wget https://get.symfony.com/cli/installer -O - | bash
sudo mv ~/.symfony/bin/symfony /usr/local/bin/symfony
- name: execute functional tests
env:
SYMFONY_VERSION: ${{ matrix.symfony }}
run: composer run-script phpunit-functional
- name: show running containers
run: docker ps
11 changes: 8 additions & 3 deletions Tests/Functional/Scripts/requireAdditionalVendors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ composer config use-github-api false

composer require php-http/curl-client # virtual php-http/client-implementation
composer require http-interop/http-factory-guzzle # virtual psr/http-factory-implementation
composer require auxmoney/opentracing-bundle-php-http-httplug-bundle

rm -rf vendor/auxmoney/opentracing-bundle-php-http-httplug-bundle/*
cp -r ../../!(build|vendor) vendor/auxmoney/opentracing-bundle-php-http-httplug-bundle
VENDOR_VERSION=""
CURRENT_REF=${GITHUB_HEAD_REF:-$GITHUB_REF}
CURRENT_BRANCH=${CURRENT_REF#refs/heads/}
if [[ $CURRENT_BRANCH -ne "master" ]]; then
composer config minimum-stability dev
VENDOR_VERSION=":dev-${CURRENT_BRANCH}"
fi
composer require auxmoney/opentracing-bundle-php-http-httplug-bundle${VENDOR_VERSION}
composer dump-autoload
cd ../../

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"type": "symfony-bundle",
"license": "MIT",
"require": {
"php": "^7.3.27",
"php": "^7.4|^8.0",
"opentracing/opentracing": "^1.0.1",
"auxmoney/opentracing-bundle-core": "^v1.0",
"php-http/httplug-bundle": "^1.20"
Expand Down
Loading

0 comments on commit 7a74fbf

Please sign in to comment.