-
Notifications
You must be signed in to change notification settings - Fork 29
83 lines (71 loc) · 2.24 KB
/
validate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Behat tests
on:
pull_request:
branches:
- master
- main
jobs:
validate:
name: "Run validation test suite"
runs-on: ubuntu-latest
env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
WP_CLI_BIN_DIR: /tmp/wp-cli-phar
DB_NAME: pantheon
DB_USER: pantheon
DB_PASSWORD: pantheon
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: ${{ env.DB_NAME }}
MYSQL_HOST: 127.0.0.1
MYSQL_USER: ${{ env.DB_USER }}
MYSQL_PASSWORD: ${{ env.DB_PASSWORD }}
MYSQL_ROOT_PASSWORD: rootpass
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
ini-values: post_max_size=256M, max_execution_time=120
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer Downloads
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache PHP dependencies
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
- name: Install composer dependencies
run: |
composer --no-interaction --no-progress --prefer-dist install
- name: Install WP-CLI
run: |
# The Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR
mkdir -p $WP_CLI_BIN_DIR
curl -s https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > $WP_CLI_BIN_DIR/wp
chmod +x $WP_CLI_BIN_DIR/wp
- name: Generate Phar
run: |
php -dphar.readonly=0 vendor/bin/box build -v
- name: Run Behat tests
run: |
vendor/bin/behat --ansi