-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [7.2] | ||
include: | ||
- php: 'nightly' | ||
continue-on-error: true | ||
|
||
services: | ||
mariadb: | ||
image: mariadb:10.0 | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
|
||
env: | ||
WP_PROJECT_TYPE: plugin | ||
WP_VERSION: latest | ||
WP_MULTISITE: 0 | ||
WP_TEST_URL: http://localhost:80 | ||
WP_TEST_USER: test | ||
WP_TEST_USER_PASS: test | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.2 | ||
extensions: mbstring, xml, ctype, iconv, intl, mysql | ||
ini-values: post_max_size=256M, short_open_tag=On | ||
tools: composer:v2 | ||
|
||
- name: Install system packages | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y apache2 libapache2-mod-fcgid nodejs php-fpm mariadb-client-10.3 mariadb-client | ||
sudo a2enmod rewrite actions fcgid alias proxy_fcgi setenvif | ||
sudo a2enconf php7.2-fpm | ||
sudo mysql -h mariadb -e '\q' | ||
sudo echo "Exit code was: $?" | ||
- name: Composer Global Packages | ||
run: | | ||
composer self-update | ||
COMPOSER_MEMORY_LIMIT=-1 composer global require "codeception/module-asserts" | ||
COMPOSER_MEMORY_LIMIT=-1 composer global require "codeception/codeception" | ||
- name: Configure PHP and Apache | ||
run: | | ||
echo "cgi.fix_pathinfo = 1" | sudo tee -a /etc/php/7.2/fpm/php.ini | ||
# Apache configuration steps | ||
cd .. | ||
echo "$(curl -fsSL https://gist.github.com/matthewjackowski/b772ab278efb0e6f30ad/raw/travisci-apache)" | sed -e "s,%TRAVIS_BUILD_DIR%,`pwd`/wordpress,g" | sudo tee /etc/apache2/sites-available/default > /dev/null | ||
cat /etc/apache2/sites-available/default | ||
cd transifex-live-wordpress | ||
git clone https://github.com/Seravo/wordpress-test-template wordpress-test-template | ||
echo "$(curl -fsSL https://gist.githubusercontent.com/matthewjackowski/3b26061241545564ae8d/raw/install-wp-tests.sh)" | sudo tee ./install-wp-tests.sh > /dev/null | ||
bash ./install-wp-tests.sh test root '' localhost $WP_VERSION | ||
sudo service apache2 restart | ||
sudo service php7.2-fpm restart | ||
- name: Run tests | ||
run: | | ||
codecept run | ||
- name: Deploy | ||
if: github.ref == 'refs/heads/master' | ||
run: | | ||
sudo chmod +x ./wp-plugin-deploy.sh | ||
./wp-plugin-deploy.sh | ||
- name: Log failure | ||
if: failure() | ||
run: | | ||
sudo cat /var/log/apache2/error.log | ||
cat ./tests/_output/ConfigurePluginCept.fail.html | ||
cat ./tests/_output/CheckLiveSnippetCept.fail.html |