Skip to content

Commit

Permalink
Use PHP 8.0 in CI due to failing runs (#289)
Browse files Browse the repository at this point in the history
* Use PHP 8.0

* Bump actions/checkout to v3

* Run composer update

* Bump php-cs-fixer for PHP 8.0 support

* Fixing failing tests due to new duplicity checks in Mautic

Co-authored-by: John Linhart <admin@escope.cz>
  • Loading branch information
dennisameling and escopecz committed Jan 17, 2023
1 parent 494807f commit ac02933
Show file tree
Hide file tree
Showing 7 changed files with 514 additions and 527 deletions.
4 changes: 2 additions & 2 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: api-library
type: php
docroot: ""
php_version: "7.4"
php_version: "8.0"
webserver_type: apache-fpm
router_http_port: "80"
router_https_port: "443"
Expand All @@ -13,7 +13,7 @@ mysql_version: ""
provider: default
use_dns_when_possible: true
composer_version: "2"
webimage_extra_packages: [php7.4-imap]
webimage_extra_packages: [php8.0-imap]
hooks:
post-start:
- exec: "./.ddev/mautic-setup.sh"
16 changes: 8 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ jobs:
- 6379:6379

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Copy our API library config into the tests/ folder
run: cp -a ./.github/ci-files/local.config.php tests/local.config.php

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
ini-values: session.save_handler=redis, session.save_path="tcp://127.0.0.1:6379"
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql
coverage: pcov
Expand All @@ -63,12 +63,12 @@ jobs:
run: |
sudo add-apt-repository ppa:ondrej/php -y
sudo add-apt-repository ppa:ondrej/apache2 -y
sudo apt-get install apache2 libapache2-mod-php7.4
sudo apt-get install apache2 libapache2-mod-php8.0
sudo a2enmod rewrite
sudo sed -i 's,^session.save_handler =.*$,session.save_handler = redis,' /etc/php/7.4/apache2/php.ini
sudo sed -i 's,^;session.save_path =.*$,session.save_path = "tcp://127.0.0.1:6379",' /etc/php/7.4/apache2/php.ini
sudo sed -i 's,^session.save_handler =.*$,session.save_handler = redis,' /etc/php/8.0/apache2/php.ini
sudo sed -i 's,^;session.save_path =.*$,session.save_path = "tcp://127.0.0.1:6379",' /etc/php/8.0/apache2/php.ini
sudo service apache2 restart
cat /etc/php/7.4/apache2/php.ini | grep session
cat /etc/php/8.0/apache2/php.ini | grep session
- name: Install dependencies
run: |
Expand Down Expand Up @@ -141,12 +141,12 @@ jobs:
name: CS tests

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
php-version: 8.0
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite, mysql, pdo_mysql

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"require-dev": {
"kint-php/kint": "^4.1",
"friendsofphp/php-cs-fixer": "~2.16.1",
"friendsofphp/php-cs-fixer": "^2.19.3",
"phpunit/phpunit": "~9.5.0",
"brianium/paratest": "^6.2"
},
Expand Down

0 comments on commit ac02933

Please sign in to comment.