Skip to content

Add Support for PHP 8.3 #174

Add Support for PHP 8.3

Add Support for PHP 8.3 #174

Workflow file for this run

name: Valet Plus test pipeline
on:
push:
branches: [ 2.x ]
pull_request:
branches: [ 2.x ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel# All actions starting with [INSTALL] are installation instructions that can be found
# in the Valet+ installation wiki page: https://github.com/weprovide/valet-plus/wiki/Installation
jobs:
test:
# Build on Catalina and later Big Sur (Not public released yet: https://github.com/actions/virtual-environments/issues/2486)
strategy:
matrix:
os: [macos-10.15]
runs-on: ${{matrix.os}}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel# All actions starting with [INSTALL] are installation instructions that can be found
# in the Valet+ installation wiki page: https://github.com/weprovide/valet-plus/wiki/Installation
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Valet install command test cases
- name: '[INSTALL] Brew update'
run: brew update
# For the Valet+ CI/CD remove the default brew PHP. Instead use valet-php.
# On a local installation one might choose to keep his/her default brew PHP installation.
- name: '[INSTALL] Brew uninstall php'
run: |
brew uninstall php
# Install the valet-php brew tap.
- name: '[INSTALL] Brew tap henkrehost/php'
run: |
brew tap henkrehorst/php
# Remove 2to3 to ensure python installation: https://github.com/weprovide/valet-plus/issues/558
# Install the default PHP version (currently: [email protected]).
- name: '[INSTALL] Brew install [email protected]'
run: |
rm /usr/local/bin/2to3
brew install [email protected] --build-from-source
# Link [email protected] as default php binary.
- name: '[INSTALL] Brew link [email protected]'
run: |
brew link [email protected] --force
php -v | grep 7.3
# Since the Github actions CI/CD image comes with composer pre-installed there is no need to install composer.
# However the image might change in the future. To ensure installation over several images an IF ELSE used.
# If installed print "Composer is already installed!" else install composer from brew.
# This way even if the image changes the installation instruction would be checked.
- name: '[INSTALL] Brew install composer'
run: |
if which composer | grep -q composer; then echo Composer is already installed!; else brew install composer; fi
- name: '[INSTALL] Composer install'
run: |
composer install
# If the code style does not pass there is no need to run other tests.
- name: '[CODE STYLE] Check PSR-2'
run: |
./vendor/squizlabs/php_codesniffer/bin/phpcs
# Somewhere around this point the Valet+ binary needs to be referenced in your PATH.
# Since the CI/CD targeting the binary directly the CI/CD does not check this.
- name: '[INSTALL] Valet fix'
run: |
./valet fix
- name: '[INSTALL] Valet install'
run: |
./valet install
# Nginx test cases
# Check if nginx was able to start correctly.
- name: '[NGINX] Sudo nginx -t'
run: |
sudo nginx -t
# Check if the Valet+ localhost page is reachable.
- name: '[NGINX] Check local host'
run: |
curl 127.0.0.1 | grep "Valet - Not Found"
# PHP 5.6 Command test cases
- name: '[PHP 5.6] Switch to'
run: |
./valet use 5.6
- name: '[PHP 5.6] Check version'
run: |
php -v | grep 5.6
- name: '[PHP 5.6] xdebug on and off'
run: |
./valet xdebug on
./valet xdebug off
- name: '[PHP 5.6] ioncube on and off'
run: |
./valet ioncube on
./valet ioncube off
# PHP 7.0 Command test cases
- name: '[PHP 7.0] Switch to'
run: |
./valet use 7.0
- name: '[PHP 7.0] Check version'
run: |
php -v | grep 7.0
- name: '[PHP 7.0] xdebug on and off'
run: |
./valet xdebug on
./valet xdebug off
- name: '[PHP 7.0] ioncube on and off'
run: |
./valet ioncube on
./valet ioncube off
# PHP 7.1 Command test cases
- name: '[PHP 7.1] Switch to'
run: |
./valet use 7.1
- name: '[PHP 7.1] Check version'
run: |
php -v | grep 7.1
- name: '[PHP 7.1] xdebug on and off'
run: |
./valet xdebug on
./valet xdebug off
- name: '[PHP 7.1] ioncube on and off'
run: |
./valet ioncube on
./valet ioncube off
# PHP 7.2 Command test cases
- name: '[PHP 7.2] Switch to'
run: |
./valet use 7.2
- name: '[PHP 7.2] Check version'
run: |
php -v | grep 7.2
- name: '[PHP 7.2] xdebug on and off'
run: |
./valet xdebug on
./valet xdebug off
- name: '[PHP 7.2] ioncube on and off'
run: |
./valet ioncube on
./valet ioncube off
# PHP 7.3 Command test cases
- name: '[PHP 7.3] Switch to'
run: |
./valet use 7.3
- name: '[PHP 7.3] Check version'
run: |
php -v | grep 7.3
- name: '[PHP 7.3] xdebug on and off'
run: |
./valet xdebug on
./valet xdebug off
- name: '[PHP 7.3] ioncube on and off'
run: |
./valet ioncube on
./valet ioncube off
# PHP 7.4 Command test cases
- name: '[PHP 7.4] Switch to'
run: |
./valet use 7.4
- name: '[PHP 7.4] Check version'
run: |
php -v | grep 7.4
- name: '[PHP 7.4] xdebug on and off'
run: |
./valet xdebug on
./valet xdebug off
- name: '[PHP 7.4] ioncube on and off'
run: |
./valet ioncube on
./valet ioncube off
# PHP 8.0 Command test cases
- name: '[PHP 8.0] Switch to'
run: |
./valet use 8.0
- name: '[PHP 8.0] Check version'
run: |
php -v | grep 8.0
- name: '[PHP 8.0] xdebug on and off'
run: |
./valet xdebug on
./valet xdebug off
- name: '[PHP 8.0] ioncube on and off'
run: |
./valet ioncube on
./valet ioncube off
# Test Memcached
- name: '[MEMCACHED] install'
run: |
brew reinstall pkg-config
./valet memcache install
- name: '[MEMCACHED] uninstall'
run: |
./valet memcache uninstall
# Extensions of commonly run commands, generally not hit or checked by the installation instructions.
# Chown the default PHP version to ensure deletion is possible.
# If we don't chown we'll get an permission error from the CI/CD.
# On local installations the printed instructions can be followed
# to manually remove the Cellar files.
- name: '[INSTALL] Valet fix --reinstall'
run: |
sudo chmod -R 777 /usr/local/Cellar/[email protected]
./valet fix --reinstall