up web #1495
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: CarbonPHP Feature Test Suit | |
on: | |
push: | |
branches: | |
- lts | |
jobs: | |
Linux: | |
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} | |
runs-on: ${{matrix.operating-system}} | |
container: ${{matrix.container}} | |
strategy: | |
max-parallel: 4 | |
matrix: | |
operating-system: [ ubuntu-latest ] | |
php-versions: [ '8.2' ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, intl | |
ini-values: post_max_size=256M, short_open_tag=On | |
coverage: xdebug | |
tools: php-cs-fixer, phpunit | |
env: | |
update: true # specify true or false | |
- name: service --status-all | |
run: service --status-all | |
- name: sudo systemctl start mysql.service | |
run: sudo systemctl start mysql.service | |
- name: echo -e "[client]\n user=root \n password=root \n host=localhost" > `pwd`/mysql.cnf | |
run: echo -e "[client]\n user=root \n password=root \n host=localhost" > `pwd`/mysql.cnf | |
- name: mysql --defaults-extra-file="`pwd`/mysql.cnf" -e "create database \`CarbonPHP\`" | |
run: mysql --defaults-extra-file="`pwd`/mysql.cnf" -e "create database \`CarbonPHP\`" | |
- name: mysql --defaults-extra-file="`pwd`/mysql.cnf" -e "GRANT ALL PRIVILEGES ON CarbonPHP. * TO 'root'@'localhost';" | |
run: mysql --defaults-extra-file="`pwd`/mysql.cnf" -e "GRANT ALL PRIVILEGES ON CarbonPHP. * TO 'root'@'localhost';" | |
- name: mysql --defaults-extra-file="`pwd`/mysql.cnf" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';" | |
run: mysql --defaults-extra-file="`pwd`/mysql.cnf" -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';" | |
- name: composer validate | |
run: composer validate | |
- name: composer install --prefer-dist --no-progress --no-scripts | |
run: composer install --prefer-dist --no-progress --no-scripts | |
- name: composer db | |
run: composer db | |
- name: WordPress download latest-stable | |
run: | | |
php -r "copy('https://wordpress.org/latest.tar.gz', 'latest.tar.gz');" | |
tar xfz latest.tar.gz | |
cp -R -n wordpress/* ./ | |
rm -rf wordpress | |
rm -f latest.tar.gz | |
- name: composer require wp-cli/wp-cli-bundle --no-scripts | |
run: composer require wp-cli/wp-cli-bundle --no-scripts | |
- name: ./vendor/bin/wp core install --url=127.0.0.1:8080 --title=CarbonPHP --admin_user=root --admin_password=password [email protected] | |
run: ./vendor/bin/wp core install --url=127.0.0.1:8080 --title=CarbonPHP --admin_user=root --admin_password=password [email protected] | |
- name: ./vendor/bin/wp core update-db | |
run: ./vendor/bin/wp core update-db | |
- name: composer db | |
run: composer db | |
- name: ./vendor/se/selenium-server-standalone/composer/bin/selenium-server-standalone & | |
run: ./vendor/se/selenium-server-standalone/composer/bin/selenium-server-standalone & | |
- name: composer run rest | |
run: composer run rest | |
- name: composer run rest (again to ensure generated php valid and to build Wp Tables) | |
run: composer run rest | |
# Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" | |
# Docs: https://getcomposer.org/doc/articles/scripts.md | |
- name: composer run test (Run test suite) | |
run: composer run test |