From 0ce9eee97d3fa05260601e83b6047f513838e93e Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Tue, 2 Jan 2024 14:33:21 +1100 Subject: [PATCH] Fixed PHP version compatibility. --- .editorconfig | 26 ++++++++++++++++++++++++++ .gitattributes | 8 +++++--- .github/workflows/release.yml | 17 ----------------- .github/workflows/test.yml | 5 +++++ README.md | 2 +- composer.json | 6 +++--- 6 files changed, 40 insertions(+), 24 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f0a81f6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,26 @@ +# This is the top-most .editorconfig file; do not search in parent directories. +root = true + +# All files. +[*] +end_of_line = LF +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.php] +indent_size = 2 + +[*.{json,lock}] +indent_size = 4 + +[*.{yml,yaml}] +indent_size = 2 + +[*.{sh,bash,bats}] +indent_size = 2 + +[*.xml] +indent_size = 4 diff --git a/.gitattributes b/.gitattributes index d008354..def2077 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,8 @@ # Ignore files for distribution archives. -/.cirleci export-ignore -/tests export-ignore +/.gitattributes export-ignore /.gitignore export-ignore /phpcs.xml export-ignore -/.gitattributes export-ignore +/phpmd.xml export-ignore +/phpstan.neon export-ignore +/tests export-ignore +/renovate.json export-ignore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4747016..861d1fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,20 +20,3 @@ jobs: - uses: release-drafter/release-drafter@v5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - release-php: - if: startsWith(github.ref, 'refs/tags/') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v3 - with: - path: /tmp/composer-cache - key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - - uses: php-actions/composer@v6 - - name: Get Tag Name - id: get-version - run: echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT - - name: Create Release - uses: softprops/action-gh-release@v1 - with: - files: | diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 34cfbf8..96efeda 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,9 @@ on: jobs: test-php: runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['8.1', '8.2', '8.3'] steps: - uses: actions/checkout@v4 - uses: actions/cache@v3 @@ -19,6 +22,8 @@ jobs: path: /tmp/composer-cache key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} - run: composer install - run: composer lint - run: composer test diff --git a/README.md b/README.md index 4331474..0cc4bdd 100644 --- a/README.md +++ b/README.md @@ -45,4 +45,4 @@ composer lint:fix ```bash composer test ``` - + diff --git a/composer.json b/composer.json index 3254b93..b20f78c 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "issues": "https://github.com/drevops/behat-phpserver/issues", "source": "https://github.com/drevops/behat-phpserver" }, - "require": { + "require": { "php": ">=8.1", "behat/behat": "^3.13" }, @@ -30,7 +30,7 @@ "phpmd/phpmd": "^2.15", "phpstan/phpstan": "^1.10", "squizlabs/php_codesniffer": "^3.8", - "symfony/http-client": "^7.0" + "symfony/http-client": "^6 || ^7.0" }, "replace": { "integratedexperts/behat-phpserver": "self.version" @@ -48,7 +48,7 @@ "scripts": { "lint": [ "phpcs", - "phpmd --exclude vendor,vendor-bin,node_modules . text phpmd.xml", + "phpmd --exclude vendor . text phpmd.xml", "phpstan" ], "lint:fix": "phpcbf",