Skip to content

Commit

Permalink
Merge pull request #156 from jrushlow/ci/replace-travis
Browse files Browse the repository at this point in the history
change CI and bump supported versions
  • Loading branch information
weaverryan authored Mar 2, 2021
2 parents 60cb6fb + 97f4e91 commit 5937765
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 51 deletions.
89 changes: 82 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ name: KnpTimeBundle Tests

on:
push:
# branches:
# - master
branches:
- master
pull_request:
release:

#env:
# PHPUNIT_FLAGS: '-v'
# SYMFONY_REQUIRE: '>=2.8'

jobs:
composer-validate:
name: Validate composer.json
Expand All @@ -24,4 +20,83 @@ jobs:
uses: actions/checkout@v2

- name: Validate
run: composer validate --strict
run: composer validate --strict

stable-tests:
name: Stable
runs-on: ubuntu-18.04

strategy:
fail-fast: false
matrix:
php-versions: [ '7.2', '7.3', '7.4', '8.0' ]

steps:
- name: Set PHP Version
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-versions }}

- name: Get PHP Version
run: |
ver=$(php -v | grep -oP '(?<=PHP )\d.\d')
echo "::set-output name=version::$ver"
id: php-ver

- name: Using PHP Version from matrix
run: |
echo "Runner is not using PHP Version defined in the php-versions matrix."
php -v
exit 1
if: steps.php-ver.outputs.version != matrix.php-versions

- name: Checkout
uses: actions/checkout@v2

- name: Require symfony/flex
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main

- name: Install Composer Dependencies
run: composer update --prefer-dist --no-progress

- name: PHPUnit
run: vendor/bin/simple-phpunit

lowest-tests:
name: Lowest Dependencies
runs-on: ubuntu-18.04

env:
SYMFONY_PHPUNIT_VERSION: 9.5

strategy:
fail-fast: false
matrix:
php-versions: [ '7.4', '8.0' ]

steps:
- name: Set PHP Version
run: sudo update-alternatives --set php /usr/bin/php${{ matrix.php-versions }}

- name: Get PHP Version
run: |
ver=$(php -v | grep -oP '(?<=PHP )\d.\d')
echo "::set-output name=version::$ver"
id: php-ver

- name: Using PHP Version from matrix
run: |
echo "Runner is not using PHP Version defined in the php-versions matrix."
php -v
exit 1
if: steps.php-ver.outputs.version != matrix.php-versions

- name: Checkout
uses: actions/checkout@v2

- name: Require symfony/flex
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-main

- name: Install Composer Dependencies
run: composer update --prefer-lowest --prefer-dist --no-progress

- name: PHPUnit
run: vendor/bin/simple-phpunit
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

14 changes: 9 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,27 @@
],

"require": {
"php": ">=7.1.3",
"symfony/dependency-injection": "~3.4|^4.3|^5.0",
"php": ">=7.2.5",
"symfony/dependency-injection": "^4.3|^5.0",
"symfony/translation": "^4.3|^5.0",
"symfony/config": "~3.4|^4.3|^5.0"
"symfony/config": "^4.3|^5.0"
},

"require-dev": {
"symfony/framework-bundle": "^4.3|^5.0",
"symfony/phpunit-bridge": "^4.3|^5.0",
"symfony/templating": "~3.4|^4.3|^5.0",
"symfony/phpunit-bridge": "^5.2",
"symfony/templating": "^4.3|^5.0",
"symfony/twig-bundle": "^4.3|^5.0"
},

"suggest": {
"symfony/twig-bundle": "to use the Twig `time_diff()` function or `|ago` filter"
},

"conflict": {
"phpunit/phpunit": "<8.0"
},

"autoload": {
"psr-4": {
"Knp\\Bundle\\TimeBundle\\": ""
Expand Down
6 changes: 5 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/6.3/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.3/phpunit.xsd"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
failOnRisky="true"
failOnWarning="true"
>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
</php>

<testsuites>
<testsuite name="Project Test Suite">
<directory>Tests</directory>
Expand Down

0 comments on commit 5937765

Please sign in to comment.