scaffold-package-command/templates/testing.yml
Nilambar Sharma 88190880cb
Add github option for --ci in scaffold package tests (#237)
* Add GH actions in scaffold package test

* Move testing file to templates

* Use a more specific name

* Revert "Use a more specific name"

This reverts commit ddbf77319d.

---------

Co-authored-by: Daniel Bachhuber <daniel.bachhuber@automattic.com>
2024-03-23 03:41:44 -07:00

52 lines
1.2 KiB
YAML

name: Testing
on:
pull_request:
branches:
- main
- master
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
behat:
strategy:
matrix:
php-version: ['8.2', '8.0', '7.4']
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: wp_cli_test
MYSQL_USER: wp_cli_test
MYSQL_PASSWORD: password1
MYSQL_HOST: 127.0.0.1
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Check out source code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer
- name: Install composer packages
run: composer install
- name: Run Behat
run: composer behat
env:
WP_CLI_TEST_DBUSER: wp_cli_test
WP_CLI_TEST_DBPASS: password1
WP_CLI_TEST_DBNAME: wp_cli_test
WP_CLI_TEST_DBHOST: 127.0.0.1:${{ job.services.mysql.ports[3306] }}