Fix/issue 36360 #14285
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run unit tests on PR | |
on: | |
pull_request: | |
paths-ignore: | |
- '**/changelog/**' | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: {} | |
jobs: | |
test: | |
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.user.login != 'github-actions[bot]' }} | |
name: PHP ${{ matrix.php }} WP ${{ matrix.wp }} ${{ matrix.hpos && 'HPOS' || '' }} | |
timeout-minutes: 30 | |
runs-on: ubuntu-20.04 | |
permissions: | |
contents: read | |
continue-on-error: ${{ matrix.wp == 'nightly' }} | |
env: | |
HPOS: ${{ matrix.hpos }} | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ '7.4', '8.0' ] | |
wp: [ "latest" ] | |
include: | |
- wp: nightly | |
php: '7.4' | |
- wp: '6.0' | |
php: 7.4 | |
- wp: '5.9' | |
php: 7.4 | |
- wp: 'latest' | |
php: '7.4' | |
hpos: true | |
services: | |
database: | |
image: mysql:5.6 | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup WooCommerce Monorepo | |
uses: ./.github/actions/setup-woocommerce-monorepo | |
with: | |
php-version: ${{ matrix.php }} | |
- name: Tool versions | |
run: | | |
php --version | |
composer --version | |
- name: Init DB and WP | |
working-directory: plugins/woocommerce | |
run: ./tests/bin/install.sh woo_test root root 127.0.0.1 ${{ matrix.wp }} | |
- name: Run tests | |
working-directory: plugins/woocommerce | |
run: pnpm run test --filter=woocommerce --color |