Export translation entries without references to files #93
Workflow file for this run
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: Behat | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
behat: | |
name: Behat${{ matrix.coverage && ' with coverage' || '' }} (PHP ${{ matrix.php }}, WordPress ${{ matrix.wordpress }}, GlotPress ${{ matrix.glotpress }}) | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental }} | |
services: | |
mysql: | |
image: mysql:5.7 | |
ports: | |
- 3306/tcp | |
env: | |
MYSQL_ROOT_PASSWORD: password | |
# Set health checks to wait until mysql has started | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 3 | |
-e MYSQL_ROOT_PASSWORD=root | |
-e MYSQL_DATABASE=wp_cli_test | |
--entrypoint sh mysql:5.7 | |
-c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password" | |
strategy: | |
matrix: | |
os: [ ubuntu-latest ] | |
php: [ '7.4' ] | |
wordpress: [ 'latest', 'nightly' ] | |
glotpress: [ 'develop' ] | |
experimental: [ false ] | |
include: | |
# - php: '8.0' | |
# os: ubuntu-latest | |
# experimental: true | |
- os: ubuntu-latest | |
php: '7.2' | |
wordpress: 'latest' | |
glotpress: 'latest' | |
experimental: false | |
- os: ubuntu-latest | |
php: '7.3' | |
wordpress: 'latest' | |
glotpress: 'latest' | |
experimental: false | |
- os: ubuntu-latest | |
php: '7.4' | |
wordpress: 'latest' | |
glotpress: 'develop' | |
experimental: false | |
coverage: true | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v3 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
coverage: ${{ matrix.coverage && 'pcov' || 'none' }} | |
tools: composer | |
ini-values: pcov.directory=.,pcov.exclude=~(vendor|tests)~ | |
- name: Shutdown default MySQL service | |
run: sudo service mysql stop | |
- name: Verify MariaDB connection | |
run: | | |
while ! mysqladmin ping -h"127.0.0.1" -P"${{ job.services.mysql.ports[3306] }}" --silent; do | |
sleep 1 | |
done | |
- name: Install PHP dependencies | |
uses: ramsey/composer-install@v2 | |
- name: Make Composer packages available globally | |
run: | | |
echo "${PWD}/vendor/bin" >> $GITHUB_PATH | |
- name: Install WP-CLI | |
run: | | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
mkdir -p bin | |
mv wp-cli.phar bin/wp | |
echo "WP_CLI_BIN_DIR=${PWD}/bin" >> $GITHUB_ENV | |
- name: Update PHPUnit to get latest php-code-coverage library | |
if: ${{ matrix.coverage == true }} | |
# phpunit/phpunit has to be updated as the one in use provides an older version of phpunit/php-code-coverage, | |
# but we need the v9.x branch. | |
# It cannot be removed, as it is a requirement of wp-cli/wp-cli-tests as well. | |
run: | | |
composer require --dev --ignore-platform-reqs --update-with-all-dependencies phpunit/phpunit | |
- name: Configure DB environment | |
run: | | |
export MYSQL_HOST=127.0.0.1 | |
export MYSQL_TCP_PORT=${{ job.services.mysql.ports['3306'] }} | |
echo "WP_CLI_TEST_DBROOTUSER=root" >> $GITHUB_ENV | |
echo "WP_CLI_TEST_DBROOTPASS=root" >> $GITHUB_ENV | |
echo "WP_CLI_TEST_DBUSER=wp_cli_test" >> $GITHUB_ENV | |
echo "WP_CLI_TEST_DBPASS=password1" >> $GITHUB_ENV | |
echo "WP_CLI_TEST_DBHOST=$MYSQL_HOST:$MYSQL_TCP_PORT" >> $GITHUB_ENV | |
- name: Prepare test database | |
run: composer prepare-tests | |
- name: Check Behat environment | |
run: WP_CLI_TEST_DEBUG_BEHAT_ENV=1 BEHAT_FEATURES_FOLDER=tests/features composer behat | |
- name: Run tests | |
env: | |
BEHAT_CODE_COVERAGE: ${{ matrix.coverage }} | |
BEHAT_FEATURES_FOLDER: tests/features | |
run: composer behat || composer behat-rerun | |
- name: Retrieve list of coverage files | |
id: coverage_files | |
if: ${{ matrix.coverage == true }} | |
run: | | |
FILES=$(ls -d -1 "$GITHUB_WORKSPACE/build/logs/clover-behat/"*.* | paste --serial --delimiters=",") | |
test -n "$FILES" | |
echo "Coverage files: $FILES" | |
echo "::set-output name=COVERAGE_FILES::$FILES" | |
- name: Upload code coverage report | |
if: ${{ matrix.coverage }} | |
uses: codecov/codecov-action@v3 | |
with: | |
files: ${{ steps.coverage_files.outputs.COVERAGE_FILES }} | |
flags: feature | |
fail_ci_if_error: true |