Skip to content

Bump minimal PHP version to 8.0 #204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2023
Merged
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
84 changes: 14 additions & 70 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,23 @@ name: Tests

on:
push:
branches: [ main ]
pull_request:

jobs:
tests:
name: PHP ${{ matrix.php }}; Symfony ${{ matrix.symfony }}
runs-on: ubuntu-20.04

name: Test PHP ${{ matrix.php-version }} ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
symfony: ['3', '4', '5', '6']
exclude:
- php: '5.6'
symfony: '4'
- php: '5.6'
symfony: '5'
- php: '5.6'
symfony: '6'
- php: '7.0'
symfony: '4'
- php: '7.0'
symfony: '5'
- php: '7.0'
symfony: '6'
- php: '7.1'
symfony: '5'
- php: '7.1'
symfony: '6'
- php: '7.2'
symfony: '6'
- php: '7.3'
symfony: '6'
- php: '7.4'
symfony: '6'
- php: '8.1'
symfony: '3'
php-version: ['8.1', '8.2']
composer-flags: ['']
name: ['']
include:
- php: 8.0
composer-flags: '--prefer-lowest'
name: '(prefer lowest dependencies)'

steps:
- name: Checkout Code
Expand All @@ -47,50 +28,13 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Setup Problem Matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Select Symfony 3
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "symfony/process:^3.4" --no-update --no-interaction
if: "matrix.symfony == '3'"

- name: Select Symfony 4
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "symfony/process:^4.4" --no-update --no-interaction
if: "matrix.symfony == '4'"

- name: Select Symfony 5
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "symfony/process:^5.3" --no-update --no-interaction
if: "matrix.symfony == '5'"

- name: Select Symfony 6
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer require "symfony/process:^6.0" --no-update --no-interaction
if: "matrix.symfony == '6'"

- name: Install PHP Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress
- name: Install Composer dependencies
run: |
composer update --prefer-dist --no-interaction ${{ matrix.composer-flags }}

- name: Execute PHPUnit
run: vendor/bin/phpunit
15 changes: 6 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,20 @@
}
},
"require": {
"php": "^5.6 || ^7.0 || ^8.0",
"php": "^8.0",
"ext-pcre": "*",
"symfony/polyfill-mbstring": "^1.7",
"symfony/process": "^3.4 || ^4.4 || ^5.0 || ^6.0"
"symfony/process": "^5.4 || ^6.0"
},
"require-dev": {
"ext-fileinfo": "*",
"phpspec/prophecy": "^1.10.2",
"phpunit/phpunit": "^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.20 || ^9.5.9",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^7.5.20 || ^8.5.20 || ^9.5.9",
"psr/log": "^1.0"
},
"suggest": {
"ext-fileinfo": "Required to determine the mimetype of a blob",
"psr/log": "Required to use loggers for reporting of execution"
},
"config": {
"preferred-install": "dist"
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
5 changes: 4 additions & 1 deletion tests/Gitonomy/Git/Tests/RepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@
use Gitonomy\Git\Blob;
use Gitonomy\Git\Exception\RuntimeException;
use Prophecy\Argument;
use Prophecy\PhpUnit\ProphecyTrait;

class RepositoryTest extends AbstractTest
{
use ProphecyTrait;

/**
* @dataProvider provideFoobar
*/
Expand All @@ -40,7 +43,7 @@ public function testGetBlobWithExistingWorks($repository)
public function testGetSize($repository)
{
$size = $repository->getSize();
$this->assertGreaterThanOrEqual(69, $size, 'Repository is at least 69KB');
$this->assertGreaterThanOrEqual(53, $size, 'Repository is at least 53KB');
$this->assertLessThan(80, $size, 'Repository is less than 80KB');
}

Expand Down