diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e8fd12..e617889 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,12 +5,23 @@ on: pull_request: jobs: + supported-versions-matrix: + name: Supported Versions Matrix + runs-on: ubuntu-latest + outputs: + version: ${{ steps.supported-versions-matrix.outputs.version }} + steps: + - uses: actions/checkout@v3 + - id: supported-versions-matrix + uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 latest: name: PHP ${{ matrix.php }} Latest runs-on: ubuntu-latest + needs: + - supported-versions-matrix strategy: matrix: - php: ['7.1', '7.2', '7.3', '7.4', '8.0'] + php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} steps: - name: Checkout code @@ -35,9 +46,11 @@ jobs: lowest: name: PHP ${{ matrix.php }} Lowest runs-on: ubuntu-latest + needs: + - supported-versions-matrix strategy: matrix: - php: ['7.1', '7.2', '7.3', '7.4'] + php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} steps: - name: Checkout code diff --git a/CHANGELOG.md b/CHANGELOG.md index 565ec57..ffc63b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- Detect supported PHP versions in range during CI instead of hardcoding them + ### Changed ## [3.0.1] - 2021-10-20 diff --git a/composer.json b/composer.json index 762641f..590e977 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ "php-http/httplug": "^2.0", "react/http": "^1.0", "react/event-loop": "^1.2", - "php-http/discovery": "^1.0" + "php-http/discovery": "^1.0", + "phpunit/phpunit": "^9.3.11 || ^7" }, "require-dev": { "php-http/client-integration-tests": "^3.0",