Merge pull request #605 from stellarwp/KAD-3653 #386
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PHP Compatibility | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- '**.php' | |
jobs: | |
php-compatibility: | |
name: PHP ${{ matrix.php-version }} Compatibility | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-version: ["7.4", "8.0", "8.1", "8.2", "8.3"] | |
env: | |
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_TOKEN }}"}}' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure PHP environment | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.4 | |
extensions: mbstring, intl | |
coverage: none | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- uses: ramsey/composer-install@v3 | |
with: | |
dependency-versions: highest | |
- name: Run PHP Compatibility | |
run: composer compatibility:php-${{ matrix.php-version }} |