Skip to content

Pull in https://github.com/10up/ElasticPress/pull/3791 #897

Pull in https://github.com/10up/ElasticPress/pull/3791

Pull in https://github.com/10up/ElasticPress/pull/3791 #897

Workflow file for this run

name: Test
env:
COMPOSER_VERSION: "1"
COMPOSER_CACHE: "${{ github.workspace }}/.composer-cache"
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
jobs:
wpa_local:
name: WP Acceptance - Local
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set standard 10up cache directories
run: |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
- name: Prepare composer cache
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE }}
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ env.COMPOSER_VERSION }}-
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: prestissimo, composer:v1
ini-values: memory_limit=3G
- name: Install dependencies
run: composer install
- name: Test Local
run: ./run-wpacceptance.sh -l --attempts=3
- name: Upload error screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: wpa-screenshots
path: screenshots/*.jpg
wpa_epio:
name: WP Acceptance - ElasticPress.io
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set standard 10up cache directories
run: |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
- name: Prepare composer cache
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE }}
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ env.COMPOSER_VERSION }}-
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: prestissimo, composer:v1
ini-values: memory_limit=3G
- name: Install dependencies
run: composer install
- name: Test EP.io
run: ./run-wpacceptance.sh --ep-host=${{ secrets.EPIO_HOST }} --es-shield='${{ secrets.EPIO_SHIELD }}' --ep-index-prefix=${{ secrets.EPIO_INDEX_PREFIX }} --attempts=3
- name: Upload error screenshots
uses: actions/upload-artifact@v2
if: failure()
with:
name: wpa-screenshots
path: screenshots/*.jpg
phpunit:
name: PHP Unit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Start MySQL
run: sudo systemctl start mysql.service
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Setup Elasticsearch
uses: getong/elasticsearch-action@v1.2
with:
elasticsearch version: '7.5.0'
- name: Set standard 10up cache directories
run: |
composer config -g cache-dir "${{ env.COMPOSER_CACHE }}"
- name: Prepare composer cache
uses: actions/cache@v2
with:
path: ${{ env.COMPOSER_CACHE }}
key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
composer-${{ env.COMPOSER_VERSION }}-
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
tools: composer:v1
- name: Install dependencies
run: composer install
- name: Setup WP Tests
run: |
bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1
sleep 10
- name: PHPUnit
run: |
composer run-script test
composer run-script test-single-site