Update i18n #49
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: Feature Tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
SITE_URL: simplejwtlogin.local | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
name: Run Simple-JWT-Login Feature tests | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v2 | |
- name: "Setup PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
extension-csv: mbstring, intl #setup extensions | |
ini-values-csv: post_max_size=256M, short_open_tag=On #setup php.ini configuration | |
coverage: xdebug #setup coverage driver | |
pecl: false | |
- name: "MySQL Setup" | |
run: | | |
sudo /etc/init.d/mysql start | |
mysql --user="root" --password="root" --execute="ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';" | |
- name: "Apache Setup" | |
run: | | |
sudo apt-get update | |
sudo apt-get install libapache2-mod-php8.2 | |
sudo a2enmod php8.2 | |
sudo /etc/init.d/apache2 start | |
- name: "Install WordPress" | |
run: | | |
sudo chmod -R 777 /var/www/html | |
sudo rm -rf /var/www/html/* | |
sudo apt-get update | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
php wp-cli.phar core download --path=/var/www/html/ | |
php wp-cli.phar config create --dbname=wordpress --dbuser=root --dbpass=root --dbhost=localhost --dbprefix=wp_ --path=/var/www/html | |
chmod 600 /var/www/html/wp-config.php | |
php wp-cli.phar db create --path=/var/www/html | |
php wp-cli.phar db check --path=/var/www/html | |
php wp-cli.phar core install --url="$SITE_URL" --title="Test WP" --admin_user=admin --admin_password=admin [email protected] --path=/var/www/html | |
php wp-cli.phar option get siteurl --path=/var/www/html | |
echo "127.0.0.1 $SITE_URL" | sudo tee -a /etc/hosts | |
php wp-cli.phar config set --raw WP_DEBUG true --path=/var/www/html | |
php wp-cli.phar config set --raw WP_DEBUG_LOG true --path=/var/www/html | |
php wp-cli.phar config set --raw WP_DEBUG_DISPLAY true --path=/var/www/html | |
- name: "Init the plugin" | |
run: | | |
cp -R simple-jwt-login /var/www/html/wp-content/plugins | |
php wp-cli.phar plugin activate simple-jwt-login --path=/var/www/html | |
- name: "Prepare Feature tests" | |
run: | | |
cp phpunit.xml.actions.dist /var/www/html/wp-content/plugins/phpunit.xml | |
cp composer.json /var/www/html/wp-content/plugins/composer.json | |
cp phpunit_bootstrap.php /var/www/html/wp-content/plugins/phpunit_bootstrap.php | |
cp -R tests /var/www/html/wp-content/plugins | |
cd /var/www/html/wp-content/plugins | |
composer install --prefer-dist --no-progress | |
- name: "Change /var/www/html owner" | |
run: | | |
sudo chown -R www-data:www-data /var/www/html | |
- name: "Site healthcheck" | |
run: | | |
echo "5. Test WP API" | |
curl -v "http://$SITE_URL/index.php?rest_route=/wp/v2/users" | |
echo "Test Simple-JWT-Login endpoint" | |
curl -X POST -v "http://$SITE_URL/index.php?rest_route=/simple-jwt-login/v1/users" | |
- name: "Run the Feature tests" | |
run: | | |
cd /var/www/html/wp-content/plugins/ | |
vendor/bin/phpunit --testsuite "Feature" --coverage-text --testdox |