woocommerce/plugins/woocommerce-blocks/.github/workflows/php-js-e2e-tests.yml

403 lines
11 KiB
YAML
Raw Normal View History

Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
name: Automated tests
on:
push:
branches: [trunk]
pull_request:
jobs:
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
Setup:
runs-on: ubuntu-latest
name: Setup
steps:
- uses: actions/checkout@v2
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- 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 }}-
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build:e2e-test
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: composer
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Composer install
run: |
composer install
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
PHPUnitTests:
name: PHP Unit Tests
needs: Setup
runs-on: ubuntu-latest
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
steps:
- uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: composer
- name: Composer install
run: |
composer install
- name: blocks.ini setup
run: |
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Run PHP Unit tests
run: |
npm run phpunit
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
JSUnitTests:
name: JS Unit Tests
needs: Setup
runs-on: ubuntu-latest
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
steps:
- uses: actions/checkout@v2
- 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: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build:e2e-test
- name: blocks.ini setup
run: |
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Run JavaScript Unit tests
run: |
npm run test
JSE2ETestsWP57Gutenberg:
name: JavaScipt E2E Tests (WP 5.7 with Gutenberg plugin)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
needs: Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build:e2e-test
- name: blocks.ini setup
run: |
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: composer
- name: Composer install
run: |
composer install
- name: E2E Tests (WP 5.7 with Gutenberg plugin)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.7-branch
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
run: |
chmod -R 767 ./ #needed for permissions issues
JSON='{"plugins": ["https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip","https://github.com/WP-API/Basic-Auth/archive/master.zip","https://downloads.wordpress.org/plugin/gutenberg.latest-stable.zip", "."] }'
echo $JSON > .wp-env.override.json
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
npm run wp-env start
npm run wp-env clean all
npm run test:e2e
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
JSE2ETestsWP57:
name: JavaScipt E2E Tests (WP 5.7)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
needs: Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build:e2e-test
- name: blocks.ini setup
run: |
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: composer
- name: Composer install
run: |
composer install
- name: E2E Tests (WP 5.7)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.7-branch
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
run: |
npm run wp-env start
npm run wp-env clean all
npm run test:e2e
JSE2ETestsWP56:
name: JavaScipt E2E Tests (WP 5.6)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
needs: Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build:e2e-test
- name: blocks.ini setup
run: |
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: composer
- name: Composer install
run: |
composer install
- name: E2E Tests (WP 5.6)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.6-branch
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
run: |
JSON='{"core": "WordPress/WordPress#'"$WP_VERSION"'"}'
echo $JSON > .wp-env.override.json
npm run wp-env start
npm run wp-env clean all
npm run test:e2e
JSE2ETestsWP55:
name: JavaScipt E2E Tests (WP 5.5)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
needs: Setup
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Npm install and build
run: |
npm ci
FORCE_REDUCED_MOTION=true npm run build:e2e-test
- name: blocks.ini setup
run: |
echo -e 'woocommerce_blocks_phase = 3\nwoocommerce_blocks_env = tests' > blocks.ini
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
tools: composer
- name: Composer install
run: |
composer install
- name: E2E Tests (WP 5.5)
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
env:
WOOCOMMERCE_BLOCKS_PHASE: 3
WP_VERSION: 5.5-branch
Create GitHub actions for automated tests (https://github.com/woocommerce/woocommerce-blocks/pull/3544) * Create end-to-end-tests.yml for E2E testing action * Change actions to run on push instead of PR * Install libstdc++-4.9-dev on E2E tests action * Add correct apt repository for libstc++ * Reconfigure apt-get commands for installing libstdc++ * Remove accidental inclusion of Travis config from E2E tests action * Install libkrb5-dev as part of e2e test action * Run apt commands as sudo * Install gutenberg plugin and e2e testutils * Add environment variables to E2E tests * Rename action and add further config for composer and wp-env * Rename workflow * Add jobs for WP 5.6, 5.5, and 5.4 * Fix YML indentation * Apply 767 permissions to wp-env directory * Run chmod as sudo * Comment 5.6 and 5.6 with GB out to test 5.4 more easily * Remove WP install job, since it should run on each step * Change order of wp-env start and chmod * Reorder commands for 5.4 job * Try running 5.4 tests in isolation * Reenable tests for all WP versions * Move commands out of bash script into a series of commands * Fix indentation on 5.5 job * Re-enable libkrb5-dev install * Clean wp-env before each run & upgrade wp-env to 3.0.0 * Update lock file for wp-env@3.0.0 * Reorder wp-env start and clean commands * Reorder wp-env permissions commands * Reorder wp-env permissions setup for all jobs * Reorder wp-env permissions setup for 5.5 and 5.4 * Ensure correct order for env setup and flush permalinks twice * Update jest snapshots * Remove rewrite flush command from yml * Remove npm build from every step and try it just at the start * Set correct e2e build script * Add jobs for PHP 8 * Specify PHP 8 minor version * Run PHP 8 jobs first * Remove PHP 8 jobs * Add JS Unit tests job * Remove js-unit-tests.js workflow * Remove composer install from every step, add it to its own step * Cache composer files * Bust npm cache to test nodegit * Rename npm cache * Renove npm cache entirely * Revert "Renove npm cache entirely" This reverts commit d6fac6a6ebd9162e48f64daaa8c971320756579e. * Rename npm cache back to how it was * Fix yml indentation * Remove echo from composer cache step * Revert back to composer example * Add PHP Unit tests to workflow * Add PHP Unit tests to workflow * Rename E2E tests workflow and file * deliberately break e2e and unit tests to test workflow 👺 * fix php test, should see e2e fail * revert broken e2e test * Change steps into jobs, rename workflow * Remove Travis workflow file * Add all necessary setup steps to each job * Rename Setup job and remove dependency * Add individual jobs for each E2E test environment * Add npm install and build to setup job * YML syntax fix * Remove error-causing chmod * Rename blocks.ini setup step Fixes a typographical error. * Get the latest stable version of WooCommerce for PHPUnit testing * Add PHP8.0 and PHP5.6 Unit tests * Run composer update for PHP 5.6 and PHP 8.0 * Revert "Run composer update for PHP 5.6 and PHP 8.0" This reverts commit 4f90522d0b52b7a8b9e896e9c783795be9dc5399. * Revert "Add PHP8.0 and PHP5.6 Unit tests" This reverts commit 66e317dec4af6e3a2ac6f78b6efd050e7fc5aa8e. Co-authored-by: Rua Haszard <rua.haszard@automattic.com>
2021-01-05 09:27:22 +00:00
run: |
JSON='{"core": "WordPress/WordPress#'"$WP_VERSION"'"}'
echo $JSON > .wp-env.override.json
npm run wp-env start
npm run wp-env clean all
npm run test:e2e