Update README.md #461
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: Test | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
acf_version: | |
- 5.10.2 | |
- 5.10.1 | |
- 5.9.9 | |
- 5.9.0 | |
- 5.8.13 | |
wp_docker_tag: | |
#- 4.9-php5.6-apache | |
#- 5.0-php7.0-apache | |
#- 5.1-php7.1-apache | |
- 5.2-php7.1-apache | |
- 5.3-php7.1-apache | |
- 5.4-php7.2-apache | |
- 5.5-php7.2-apache | |
- 5.6-php7.2-apache | |
- 5.7-php7.3-apache | |
#- 5.8-php7.3-apache | |
- 5.8-php7.4-apache | |
- 5.9-php7.4-apache | |
- 6.0-php7.4-apache | |
include: | |
#- wp_docker_tag: 4.9-php5.6-apache | |
# xdebug_version: xdebug-2.7.2 | |
# php_version: 5.6 | |
#- wp_docker_tag: 5.0-php7.0-apache | |
# xdebug_version: xdebug-2.7.2 | |
# php_version: '7.0' | |
#- wp_docker_tag: 5.1-php7.1-apache | |
# xdebug_version: xdebug-2.7.2 | |
# php_version: '7.1' | |
- wp_docker_tag: 5.2-php7.1-apache | |
xdebug_version: xdebug-2.7.2 | |
php_version: '7.1' | |
- wp_docker_tag: 5.3-php7.1-apache | |
xdebug_version: xdebug-2.7.2 | |
php_version: '7.1' | |
- wp_docker_tag: 5.4-php7.2-apache | |
xdebug_version: xdebug-2.7.2 | |
php_version: '7.2' | |
- wp_docker_tag: 5.5-php7.2-apache | |
xdebug_version: xdebug-2.7.2 | |
php_version: '7.2' | |
- wp_docker_tag: 5.6-php7.2-apache | |
xdebug_version: xdebug-2.7.2 | |
php_version: '7.2' | |
- wp_docker_tag: 5.7-php7.3-apache | |
xdebug_version: xdebug-2.7.2 | |
php_version: '7.3' | |
#- wp_docker_tag: 5.8-php7.3-apache | |
# xdebug_version: xdebug-2.7.2 | |
# php_version: '7.3' | |
- wp_docker_tag: 5.8-php7.4-apache | |
xdebug_version: xdebug-3.0.4 | |
php_version: '7.4' | |
- wp_docker_tag: 5.9-php7.4-apache | |
xdebug_version: xdebug-3.0.4 | |
php_version: '7.4' | |
- wp_docker_tag: 6.0-php7.4-apache | |
xdebug_version: xdebug-3.0.4 | |
php_version: '7.4' | |
fail-fast: false | |
env: | |
ACF_VERSION: ${{ matrix.acf_version }} | |
WP_DOCKER_TAG: ${{ matrix.wp_docker_tag }} | |
XDEBUG_VERSION: ${{ matrix.xdebug_version }} | |
PHP_VERSION: ${{ matrix.php_version }} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install PHP | |
uses: shivammathur/setup-php@verbose | |
with: | |
php-version: ${{ matrix.php_version }} | |
extensions: zip | |
- name: Set Node Version | |
uses: actions/setup-node@v2 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npx webpack -p | |
- run: docker-compose pull | |
#- uses: satackey/[email protected] | |
# continue-on-error: true | |
- name: Setup docker | |
run: docker-compose up -d --build | |
- name: Create config file | |
run: touch .env.testing | |
- name: Check running containers | |
run: docker ps -a | |
- name: Test | |
run: npx wait-on http://localhost/wp-login.php --verbose --timeout 60000 && docker exec -w /var/www/html acf-image-aspect-ratio-crop_wordpress.test_1 bash -c "php -i" | |
- name: Run test suite | |
run: | | |
npx wait-on http-get://localhost/wp-login.php --verbose --timeout 60000 && docker exec -w /var/www/html acf-image-aspect-ratio-crop_wordpress.test_1 bash -c "sudo chown -R www-data:www-data /var/www/html && sudo chmod -R 775 /var/www/html" && | |
docker exec -u www-data -w /var/www/html/wp-content/plugins/acf-image-aspect-ratio-crop -e WP_ROOT_FOLDER -e TEST_SITE_WP_ADMIN_PATH -e TEST_SITE_DB_NAME -e TEST_SITE_DB_HOST -e TEST_SITE_DB_USER -e TEST_SITE_DB_PASSWORD -e TEST_SITE_DB_PASSWORD -e TEST_SITE_TABLE_PREFIX -e TEST_SITE_WP_URL -e TEST_SITE_WP_DOMAIN -e TEST_SITE_ADMIN_EMAIL -e TEST_SITE_ADMIN_USERNAME -e TEST_SITE_ADMIN_PASSWORD -e CHROMEDRIVER_HOST -e CHROMEDRIVER_PORT -e WP_VERSION -e ACF_VERSION -e C3_URL -e WORDPRESS_DEBUG acf-image-aspect-ratio-crop_wordpress.test_1 bash -c 'export XDEBUG_MODE=coverage; ./vendor/bin/codecept run acceptance -vvv --fail-fast --debug' | |
env: | |
WP_ROOT_FOLDER: /var/www/html | |
TEST_SITE_WP_ADMIN_PATH: /wp-admin | |
TEST_SITE_DB_NAME: exampledb | |
TEST_SITE_DB_HOST: db | |
TEST_SITE_DB_USER: exampleuser | |
TEST_SITE_DB_PASSWORD: examplepass | |
TEST_SITE_TABLE_PREFIX: wp_ | |
TEST_SITE_WP_URL: http://wordpress.test | |
TEST_SITE_WP_DOMAIN: wordpress.test | |
TEST_SITE_ADMIN_EMAIL: [email protected] | |
TEST_SITE_ADMIN_USERNAME: admin | |
TEST_SITE_ADMIN_PASSWORD: admin | |
CHROMEDRIVER_HOST: chromedriver | |
CHROMEDRIVER_PORT: 9515 | |
C3_URL: http://wordpress.test/wp-content/plugins/acf-image-aspect-ratio-crop/acf-image-aspect-ratio-crop.php? | |
WORDPRESS_DEBUG: 1 | |
#- uses: codecov/codecov-action@v2 | |
# with: | |
# files: ./tests/_output/coverage.xml | |
# verbose: true | |
- name: Upload artifact | |
if: failure() | |
uses: actions/[email protected] | |
with: | |
name: Test output ${{ matrix.wp_docker_tag }} ${{ matrix.acf_version }} | |
path: tests/_output/ | |
- name: Dump docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v1 |