Skip to content
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

Move to GitHub Actions #137

Merged
merged 9 commits into from
Dec 30, 2021
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
37 changes: 37 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Continuous Integration

on: [push, pull_request]

jobs:
quality:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
# TODO Add 8.0 and 8.1 versions as well
php-versions: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}

- name: Install dependencies
run: composer install --no-interaction --no-progress --prefer-dist

- name: PHP Unit tests
if: ${{ matrix.php-versions != '7.3' }}
run: vendor/bin/phpunit

- name: PHP Unit tests generating coverage data
if: ${{ matrix.php-versions == '7.3' }}
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

- name: Upload code coverage data
if: ${{ matrix.php-versions == '7.3' }}
run: php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover
1 change: 0 additions & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 3
php_analyzer: true
php_code_coverage: false
php_code_sniffer:
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest version][ico-version]][link-packagist]
[![Software License][ico-license]][link-license]
[![Build Status][ico-travis]][link-travis]
[![Build Status][ico-gh-actions]][link-gh-actions]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]
Expand Down Expand Up @@ -260,15 +260,15 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio

[ico-version]: https://img.shields.io/packagist/v/hassankhan/config.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/hassankhan/config/master.svg?style=flat-square
[ico-gh-actions]: https://img.shields.io/github/workflow/status/hassankhan/config/Continuous%20Integration/master?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/hassankhan/config.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/hassankhan/config.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/hassankhan/config.svg?style=flat-square
[ico-gitter]: https://img.shields.io/badge/GITTER-JOIN%20CHAT%20%E2%86%92-brightgreen.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/hassankhan/config
[link-license]: http://hassankhan.mit-license.org
[link-travis]: https://travis-ci.org/hassankhan/config
[link-gh-actions]: https://github.com/hassankhan/config/actions?query=workflow%3A%22Continuous+Integration%22+branch%3Amaster
[link-scrutinizer]: https://scrutinizer-ci.com/g/hassankhan/config/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/hassankhan/config
[link-downloads]: https://packagist.org/packages/hassankhan/config
Expand Down
17 changes: 15 additions & 2 deletions tests/Parser/IniTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,24 @@ public function testLoadInvalidIniGBH()
/**
* @covers Noodlehaus\Parser\Ini::parseString()
* @covers Noodlehaus\Parser\Ini::parse()
* @expectedException Noodlehaus\Exception\ParseException
* @expectedExceptionMessage syntax error, unexpected $end, expecting ']'
*/
public function testLoadInvalidIni()
{
if (PHP_VERSION_ID < 70400 && PHP_VERSION_ID >= 50500) {
$exceptionMessage = "syntax error, unexpected \$end, expecting ']'";
} else {
$exceptionMessage = "syntax error, unexpected end of file, expecting ']' in Unknown on line 1";
}

if (PHP_VERSION_ID < 50600 && PHP_VERSION_ID >= 50500) {
$this->setExpectedException(
'\Noodlehaus\Exception\ParseException', $exceptionMessage
);
} else {
$this->expectException(\Noodlehaus\Exception\ParseException::class);
$this->expectExceptionMessage($exceptionMessage);
}

$this->ini->parseString(file_get_contents(__DIR__ . '/../mocks/fail/error.ini'));
}

Expand Down