Skip to content

Update test.yml

Update test.yml #261

Workflow file for this run

name: Test
on: [push]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- 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.8-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 5.9-php7.3-apache
xdebug_version: xdebug-2.7.2
php_version: 7.3
- wp_docker_tag: 5.9-php7.4-apache
xdebug_version: xdebug-3.0.4
php_version: 7.4
- wp_docker_tag: 5.9-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.0-php7.4-apache
xdebug_version: xdebug-3.0.4
php_version: 7.4
- wp_docker_tag: 6.0-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.1-php7.4-apache
xdebug_version: xdebug-3.0.4
php_version: '7.4'
- wp_docker_tag: 6.1-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.2-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.2-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.2-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.3-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.3-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.3-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.4-php8.0-apache
xdebug_version: xdebug-3.0.4
php_version: '8.0'
- wp_docker_tag: 6.4-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.4-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.5-php8.1-apache
xdebug_version: xdebug-3.2.1
php_version: '8.1'
- wp_docker_tag: 6.5-php8.2-apache
xdebug_version: xdebug-3.2.1
php_version: '8.2'
- wp_docker_tag: 6.5-php8.3-apache
xdebug_version: xdebug-3.3.1
php_version: '8.3'
fail-fast: false
env:
WP_DOCKER_TAG: ${{ matrix.wp_docker_tag }}
XDEBUG_VERSION: ${{ matrix.xdebug_version }}
PHP_VERSION: ${{ matrix.php_version }}
steps:
- uses: actions/checkout@v1
- name: Set Node Version
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: zip
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Install npm dependencies
run: npm install
- name: Build
run: npx webpack -p
- name: Setup docker
run: docker-compose up -d
- name: Create config file
run: touch .env.testing
- name: Check running containers
run: docker ps -a
- name: Run test suite
run: |
npx wait-on http://localhost/wp-login.php --verbose --timeout 60000 && docker exec -w /var/www/html disable-media-pages_wordpress.test_1 bash -c "sudo chown -R www-data:www-data /var/www/html && sudo chmod -R 775 /var/www/html && wp core install --url=wordpress --title=example --admin_user=admin [email protected]"
npx wait-on http://localhost/wp-login.php --verbose --timeout 60000 && docker exec -w /var/www/html/wp-content/plugins/disable-media-pages -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 C3_URL -e XDEBUG_MODE disable-media-pages_wordpress.test_1 bash -c './vendor/bin/codecept run acceptance --fail-fast --debug --coverage --coverage-xml'
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_SITE_ADMIN_EMAIL: [email protected]
TEST_SITE_ADMIN_USERNAME: admin
TEST_SITE_ADMIN_PASSWORD: admin
CHROMEDRIVER_HOST: chromedriver
CHROMEDRIVER_PORT: 4444
XDEBUG_MODE: coverage
C3_URL: http://wordpress.test/wp-content/plugins/disable-media-pages/disable-media-pages.php?
WP_CLI_ALLOW_ROOT: true
- name: Upload artifact
if: failure()
uses: actions/[email protected]
with:
name: Test output ${{ matrix.wp_docker_tag }}
path: tests/_output/
- uses: codecov/codecov-action@v3
with:
files: ./tests/_output/coverage.xml
verbose: true
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2