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

Migrate CI from travis to GH action for 2.x #1475

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on:
push:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: true
matrix:
operating-system: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
dependencies: [ 'lowest', 'highest' ]

name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies

steps:
- uses: actions/checkout@v2
name: Checkout repository

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

- name: Composer install
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: "${{ matrix.composer-options }}"

- name: PHPUnit Tests
run: bin/phpunit --configuration phpunit.xml.dist
25 changes: 25 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: code-style

on:
push:
pull_request:
workflow_dispatch:

jobs:
php-cs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout repository

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- uses: ramsey/composer-install@v2
with:
dependency-versions: 'highest'

- name: Check Code Style
run: ./bin/phpcs -p --extensions=php --standard=PSR2 --error-severity=1 --warning-severity=0 ./src ./tests;
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"require-dev": {
"squizlabs/php_codesniffer": ">=2.7",
"phpunit/phpunit": "^8 || ^9"
"phpunit/phpunit": "^8.5.23 || ^9"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do things really break with earlier 8.x versions?

Copy link
Author

@koriym koriym Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With PHP 8.1 and phpunit ^8

PHP Fatal error:  Cannot acquire reference to $GLOBALS in /Users/akihito/git/swagger-php/vendor/phpunit/phpunit/src/Util/Configuration.php on line 407

with PHP 8.1 and phpunit ^8.5.20

PHP Fatal error:  During inheritance of IteratorAggregate: Uncaught Return type of Symfony\Component\Finder\Finder::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

/Users/akihito/git/swagger-php/vendor/symfony/finder/Finder.php:557

Then I found this advise at stackoverflow. And I set ^8.5.23 and see problem gone.

At this point I didn't think I needed to explore the exact version, but after receiving your comment I tried several times changing the values. Then I found that it seems that the current state of this project is error free at ^8.5.21.

},
"autoload-dev": {
"psr-4": {
Expand Down
Loading