-
Notifications
You must be signed in to change notification settings - Fork 356
Switch to GH Actions #670
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
Switch to GH Actions #670
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e330d49
Add GH Actions CI and linting
Seldaek 3d7aece
Remove Travis CI config
Seldaek 7599783
Add code coverage
Seldaek f7cf6cc
Add php-cs-fixer check
Seldaek ec07e3c
Add basic phpstan level 1 config/ci
Seldaek f8f4bfd
Fix php cs fixer deprecation warnings
Seldaek cb83084
Fix README build status badge
Seldaek d11928e
Pin php-cs-fixer to 2.19
Seldaek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "Code Coverage" | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" | ||
|
||
jobs: | ||
tests: | ||
name: "Code Coverage" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
extensions: "intl, zip" | ||
ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On" | ||
php-version: "7.4" | ||
tools: composer | ||
coverage: xdebug2 | ||
|
||
- name: "Update dependencies" | ||
run: "composer update ${{ env.COMPOSER_FLAGS }}" | ||
|
||
- name: "Run coverage" | ||
run: "composer coverage" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: "Continuous Integration" | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" | ||
|
||
jobs: | ||
tests: | ||
name: "CI" | ||
|
||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "5.3" | ||
- "5.4" | ||
- "5.5" | ||
- "5.6" | ||
- "7.0" | ||
- "7.1" | ||
- "7.2" | ||
- "7.3" | ||
- "7.4" | ||
# - "8.0" | ||
dependencies: [highest] | ||
experimental: [false] | ||
include: | ||
- php-version: "5.3" | ||
dependencies: highest | ||
experimental: false | ||
- php-version: "5.3" | ||
dependencies: lowest | ||
experimental: false | ||
# - php-version: "8.0" | ||
# dependencies: highest | ||
# experimental: false | ||
# - php-version: "8.1" | ||
# dependencies: lowest-ignore | ||
# experimental: true | ||
# - php-version: "8.1" | ||
# dependencies: highest-ignore | ||
# experimental: true | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
extensions: "intl, zip" | ||
ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On" | ||
php-version: "${{ matrix.php-version }}" | ||
tools: composer | ||
|
||
- name: "Handle lowest dependencies update" | ||
if: "contains(matrix.dependencies, 'lowest')" | ||
run: "echo \"COMPOSER_UPDATE_FLAGS=$COMPOSER_UPDATE_FLAGS --prefer-lowest\" >> $GITHUB_ENV" | ||
|
||
- name: "Handle ignore-platform-reqs dependencies update" | ||
if: "contains(matrix.dependencies, 'ignore')" | ||
run: "echo \"COMPOSER_FLAGS=$COMPOSER_FLAGS --ignore-platform-req=php\" >> $GITHUB_ENV" | ||
|
||
- name: "Update dependencies" | ||
run: "composer update ${{ env.COMPOSER_UPDATE_FLAGS }} ${{ env.COMPOSER_FLAGS }}" | ||
|
||
- name: "Validate composer.json" | ||
run: "composer validate" | ||
|
||
- name: "Run tests" | ||
run: "composer test" | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "PHPStan" | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" | ||
|
||
jobs: | ||
tests: | ||
name: "PHPStan" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
extensions: "intl, zip" | ||
ini-values: "memory_limit=-1" | ||
php-version: "7.4" | ||
|
||
- name: "Update dependencies" | ||
run: "composer update ${{ env.COMPOSER_FLAGS }}" | ||
|
||
- name: Run PHPStan | ||
run: | | ||
composer require --dev phpstan/phpstan:^0.12.93 marc-mabe/php-enum-phpstan ${{ env.COMPOSER_FLAGS }} | ||
vendor/bin/phpstan analyse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: "Style Check" | ||
|
||
on: | ||
- push | ||
- pull_request | ||
|
||
env: | ||
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" | ||
|
||
jobs: | ||
tests: | ||
name: "Style Check" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
coverage: "none" | ||
extensions: "intl, zip" | ||
ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On" | ||
php-version: "7.4" | ||
tools: composer | ||
|
||
- name: "Update dependencies" | ||
run: "composer update ${{ env.COMPOSER_FLAGS }}" | ||
|
||
- name: "Run style-check" | ||
run: "composer style-check" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
parameters: | ||
ignoreErrors: | ||
- | ||
message: "#^PHPDoc tag @throws with type JsonSchema\\\\Exception\\\\ExceptionInterface is not subtype of Throwable$#" | ||
count: 1 | ||
path: src/JsonSchema/Constraints/ConstraintInterface.php | ||
|
||
- | ||
message: "#^Access to an undefined property object\\:\\:\\$properties\\.$#" | ||
count: 3 | ||
path: src/JsonSchema/SchemaStorage.php | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parameters: | ||
level: 2 | ||
paths: | ||
- ./src/ | ||
ignoreErrors: [] | ||
|
||
includes: | ||
- phpstan-baseline.neon | ||
- vendor/marc-mabe/php-enum-phpstan/extension.neon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was pinned due to an issue with newer minor versions of php-cs-fixer rewriting code in a way that actually caused logic changes, without warning. I would prefer to continue with pinning specific versions if possible, as this happened on multiple occasions with different versions of php-cs-fixer.
Is there are strong reason that requires loosening this constraint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason was allowing it to install fine on PHP 8 in development, because 2.15 requires php 5/7. But I'm happy to pin it to 2.19 instead to avoid surprises in the future.