Skip to content

Commit

Permalink
Update PHP Dependencies and run tests with PHP 8.3 (#237)
Browse files Browse the repository at this point in the history
# Summary <!-- Required -->

Updates PHP dev dependencies (patch versions) and PHP in composer to
support PHP < 9.

This PR will also add a CI workflow to run tests in PHP 8.3. 

### Closes: #236 

## Contributor checklist <!-- Required -->

<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you are unsure about any of these, please ask for
clarification. We are here to help! -->

- [x] I agree to follow this project's [**Code of
Conduct**](https://github.com/10up/.github/blob/trunk/CODE_OF_CONDUCT.md).
- [x] I have updated the documentation accordingly 
- [x] I have added tests to cover changes introduced by this pull
request
- [x] All new and existing tests pass

## Testing <!-- Required -->

- [ ] Unit tests pass with PHP 8.3 and previous PHP versions

<!-- List any configuration requirements for testing. -->

### Reviewer checklist <!-- Required -->

<!-- The following checklist is for the reviewer: add any steps that may
be relevant while reviewing this pull request -->

- [ ] Code changes review
- [ ] Documentation changes review
- [ ] Unit tests pass
- [ ] Static analysis passes


## After merge

- [ ] Tag v1.0.1
  • Loading branch information
nmolham-godaddy authored Jan 4, 2024
2 parents e9e421c + c52a4d3 commit 4249c87
Show file tree
Hide file tree
Showing 3 changed files with 322 additions and 564 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
php: [ '8.2' ]
os: [ 'ubuntu-20.04' ]
php: [ '8.3', '8.2', '8.1' ]
os: [ 'ubuntu-latest' ]
include:
- php: '8.1'
os: 'ubuntu-latest'
- php: '8.0'
os: 'ubuntu-20.04'
- php: '7.4'
Expand All @@ -29,19 +27,11 @@ jobs:
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2.4.2

# TODO: replace with https://github.com/marketplace/actions/setup-php-action
- name: Switch to PHP ${{ env.PHP_VERSION }}
run: |
sudo update-alternatives --set php /usr/bin/php$PHP_VERSION
sudo update-alternatives --set phar /usr/bin/phar$PHP_VERSION
sudo update-alternatives --set phar.phar /usr/bin/phar.phar$PHP_VERSION
sudo update-alternatives --set phpize /usr/bin/phpize$PHP_VERSION
sudo update-alternatives --set php-config /usr/bin/php-config$PHP_VERSION
- name: Enable pcov
run: |
sudo phpdismod xdebug
sudo phpenmod pcov
- name: Set up PHP ${{ matrix.php }}
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2.28.0
with:
php-version: ${{ matrix.php }}
coverage: pcov

- name: Get Composer cache directory
id: composer-cache
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
"version": "1.0.0",
"prefer-stable": true,
"require": {
"php": ">=7.4 < 8.3",
"php": ">=7.4 < 9",
"phpunit/phpunit": "^9.6",
"mockery/mockery": "^1.6",
"antecedent/patchwork": "^2.1"
},
"require-dev": {
"behat/behat": "^v3.11.0",
"sebastian/comparator": "^4.0.8",
"php-coveralls/php-coveralls": "^v2.5",
"php-coveralls/php-coveralls": "^v2.7",
"sempro/phpunit-pretty-print": "^1.4",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-mockery": "^1.1",
"phpcompatibility/php-compatibility": "^9.3",
"php-stubs/wordpress-globals": "^0.2",
"php-stubs/wordpress-stubs": "^6.2",
"php-stubs/wordpress-stubs": "^6.3",
"friendsofphp/php-cs-fixer": "^3.4",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7"
},
Expand Down
Loading

0 comments on commit 4249c87

Please sign in to comment.