Skip to content

Add CI, bump graphqlite to v5 #61

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

Closed
wants to merge 5 commits into from
Closed
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
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
pull-request-branch-name:
separator: '-'
- package-ecosystem: composer
directory: '/'
versioning-strategy: widen
schedule:
interval: weekly
pull-request-branch-name:
separator: '-'
open-pull-requests-limit: 10
77 changes: 77 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Continuous Integration

on:
pull_request: ~
push:
branches:
- master

jobs:

continuous-integration:
name: Continuous Integration

runs-on: ubuntu-latest

strategy:
matrix:
install-args: ['', '--prefer-lowest']
php-version: ['7.2', '7.3', '7.4', '8.0']
fail-fast: false

steps:
# Cancel previous runs of the same branch
- name: cancel
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v2

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

- name: composer-cache-dir
id: composercache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: composer-cache
uses: actions/cache@v2.1.6
with:
path: ${{ steps.composercache.outputs.dir }}
key: composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
restore-keys: |
composer-${{ hashFiles('**/composer.json') }}-${{ matrix.install-args }}
composer-${{ hashFiles('**/composer.json') }}-
composer-

- name: Install dependencies
run: |
composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist
if: ${{ matrix.php-version != '8.0' }}

- name: Run tests with phpunit/phpunit
run: vendor/bin/phpunit

- name: phpstan-cache
uses: actions/cache@v2.1.6
with:
key: phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}-${{ github.sha }}
path: .phpstan-cache
restore-keys: |
phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-${{ github.ref }}-
phpstan-${{ matrix.php-version }}-${{ matrix.install-args }}-
phpstan-${{ matrix.php-version }}-
phpstan-

- name: Run phpstan
run: composer phpstan

- name: Run php_codesniffer
run: composer cs-check
if: ${{ matrix.php-version == '7.2' }} # Do not suggest using features after 7.2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/build
.php_cs_cache
.phpunit.result.cache
.phpstan-cache
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
"php" : ">=7.2",
"thecodingmachine/graphqlite" : "^5.0",
"symfony/validator": "^4.2 | ^5",
"doctrine/annotations": "^1.6"
"doctrine/annotations": "^1.13"
},
"require-dev": {
"phpunit/phpunit": "^8.4.1",
"mouf/picotainer": "^1.1",
"phpstan/phpstan": "^0.12.14",
"phpstan/phpstan": "^0.12.99",
"php-coveralls/php-coveralls": "^2.1.0",
"symfony/translation": "^4",
"doctrine/coding-standard": "^9.0"
},
"scripts": {
"phpstan": "phpstan analyse src/ -c phpstan.neon --level=7 --no-progress",
"phpstan": "phpstan analyse --no-progress",
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"test": ["@cs-check", "@phpstan", "phpunit"]
Expand Down
10 changes: 6 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
parameters:
ignoreErrors:

#includes:
# - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
tmpDir: .phpstan-cache
paths:
- src
level: max
2 changes: 1 addition & 1 deletion tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ public function testException(): void
$this->expectExceptionMessage('In method TheCodingMachine\GraphQLite\Validator\Fixtures\InvalidControllers\InvalidController::invalid(), the @Assert annotation is targeting parameter "$resolveInfo". You cannot target this parameter because it is not part of the GraphQL Input type. You can only assert parameters coming from the end user.');
$schema->validate();
}
}
}