diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml new file mode 100644 index 0000000..7ffa7a6 --- /dev/null +++ b/.github/dependabot.yaml @@ -0,0 +1,15 @@ +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: '-' diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index c162d79..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: 2 -updates: -- package-ecosystem: composer - directory: "/" - schedule: - interval: daily - time: "04:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: doctrine/coding-standard - versions: - - 8.0.0 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..52fbd9d --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,74 @@ +name: test +on: + pull_request: ~ + push: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + name: test + strategy: + matrix: + install-args: [''] + php-version: ['8.1', '8.2', '8.3', '8.4'] + fail-fast: false + steps: + # Cancel previous runs of the same branch + - name: cancel + uses: styfle/cancel-workflow-action@0.12.1 + with: + access_token: ${{ github.token }} + + - name: checkout + uses: actions/checkout@v5 + + - name: php + uses: shivammathur/setup-php@2.35.5 + with: + php-version: ${{ matrix.php-version }} + ini-values: zend.assertions=1 + + - name: composer-cache-dir + id: composercache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: composer-cache + uses: actions/cache@v4.2.4 + 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: composer + run: | + composer update ${{ matrix.install-args }} --no-interaction --no-progress --prefer-dist + + - name: phpcs + run: | + vendor/bin/phpcs --no-cache + + - name: phpunit + run: | + vendor/bin/phpunit --no-coverage + + - name: phpstan-cache + uses: actions/cache@v4.2.4 + 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: phpstan + run: | + mkdir -p .phpstan-cache + vendor/bin/phpstan analyse --no-progress --no-interaction --memory-limit=1G diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b565bac..0000000 --- a/.travis.yml +++ /dev/null @@ -1,44 +0,0 @@ -language: php -sudo: false -cache: - directories: - - $HOME/.composer/cache/files - #- $HOME/symfony-bridge/.phpunit - -env: - global: - - PHPUNIT_FLAGS="-v" - #- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit" - -matrix: - fast_finish: true - include: - # Test LTS versions. - - php: 8.1 - env: DEPENDENCIES="symfony/^6" - - allow_failures: - # Minimum supported dependencies with the latest and oldest PHP version - - php: 8.1 - env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors" - # Dev-master is allowed to fail. - - env: STABILITY="dev" - -before_install: - - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi - - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; - - if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; - -install: - # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 - - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi - - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction - -script: - - composer validate --strict --no-check-lock - - composer phpstan - - composer cs-check - - ./vendor/bin/phpunit - -after_script: - - ./vendor/bin/php-coveralls -v diff --git a/composer.json b/composer.json index 96d8f72..936e3f6 100644 --- a/composer.json +++ b/composer.json @@ -19,14 +19,14 @@ "require" : { "php" : ">=8.1", "thecodingmachine/graphqlite" : "^7.0 || ^8.0", - "symfony/validator": "^6.4 || ^7" + "symfony/validator": "^6.4 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^11", + "phpunit/phpunit": "^10", "mouf/picotainer": "^1.1", "phpstan/phpstan": "^2", "php-coveralls/php-coveralls": "^2.1.0", - "symfony/translation": "^7", + "symfony/translation": "^6.4 || ^7.0 || ^8.0", "doctrine/coding-standard": "^12" }, "scripts": {