diff --git a/README.md b/README.md index aff2ff4..bc323b3 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ See [action.yml](action.yml) and the underlying script [`typisttech/php-matrix`] ## Examples
- Run tests against all supported PHP minor versions. + Run tests against all supported PHP versions. ```yaml name: Test @@ -124,7 +124,11 @@ jobs: outputs: versions: ${{ steps.php-matrix.outputs.versions }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 + with: + sparse-checkout: composer.json + sparse-checkout-cone-mode: false + - uses: typisttech/php-matrix-action@v2 id: php-matrix @@ -133,52 +137,49 @@ jobs: needs: php-matrix strategy: matrix: - php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} + php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} + php-version: ${{ matrix.php-version }} - run: composer install - run: composer test ``` -
- Run `phpstan` with the lowest supported PHP minor version. + Run tests on the highest supported PHP version only. ```yaml -name: PHPStan +name: Test on: push: jobs: - phpstan: + test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: typisttech/php-matrix-action@v2 id: php-matrix - uses: shivammathur/setup-php@v2 with: - php-version: ${{ steps.php-matrix.outputs.lowest }} + php-version: ${{ steps.php-matrix.outputs.highest }} - run: composer install - - - run: vendor/bin/phpstan analyse src + - run: composer test ``` -
- Run tests with coverage. + Run `$ composer audit` against all supported PHP versions. ```yaml -name: Test +name: Composer Audit on: push: @@ -189,8 +190,9 @@ jobs: outputs: versions: ${{ steps.php-matrix.outputs.versions }} highest: ${{ steps.php-matrix.outputs.highest }} + lowest: ${{ steps.php-matrix.outputs.lowest }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: sparse-checkout: composer.json sparse-checkout-cone-mode: false @@ -198,43 +200,38 @@ jobs: - uses: typisttech/php-matrix-action@v2 id: php-matrix - test: - runs-on: ubuntu-latest + composer-audit: needs: php-matrix + runs-on: ubuntu-latest strategy: matrix: - php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} - dependency-versions: [lowest, highest] - coverage: [none] - exclude: - - php: ${{ needs.php-matrix.outputs.highest }} - dependency-versions: highest - coverage: none + php-version: ${{ fromJSON(needs.php-matrix.outputs.versions) }} + dependency-versions: [highest] include: - - php: ${{ needs.php-matrix.outputs.highest }} - dependency-versions: highest - coverage: xdebug + - php-version: ${{ needs.php-matrix.outputs.lowest }} + dependency-versions: lowest + - php-version: ${{ needs.php-matrix.outputs.highest }} + dependency-versions: locked + env: + COMPOSER_NO_AUDIT: 1 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 + with: + sparse-checkout: | + composer.json + composer.lock + sparse-checkout-cone-mode: false - uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php }} - coverage: ${{ matrix.coverage }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + php-version: ${{ matrix.php-version }} + coverage: none - uses: ramsey/composer-install@v3 with: dependency-versions: ${{ matrix.dependency-versions }} - - run: composer test:with-coverage - if: ${{ matrix.coverage == 'xdebug' }} - - - run: composer test:without-coverage - if: ${{ matrix.coverage != 'xdebug' }} + - run: composer audit ``` -
## Credits