-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (51 loc) · 1.93 KB
/
Copy pathcodeception.yml
File metadata and controls
56 lines (51 loc) · 1.93 KB
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
name: CodeCeption
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
pull_request:
types: [ opened, labeled, synchronize ]
jobs:
build-test:
if: contains(github.event.pull_request.labels.*.name, 'run analysis')
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php: 7.4
wordpress: 5.8
- php: 7.4
wordpress: master
name: PHP ${{ matrix.php }} tests in WP ${{ matrix.wordpress }}
steps:
- uses: actions/checkout@v3.5.0
# get the PHP version
- uses: shivammathur/setup-php@2.24.0
with:
php-version: ${{ matrix.php }}
tools: phpunit-polyfills
- run: composer install --no-progress --ansi
- name: Installing WordPress
run: |
export WP_DEVELOP_DIR=/tmp/wordpress/
git clone --depth=50 --branch="${{ matrix.wordpress }}" git://develop.git.wordpress.org/ /tmp/wordpress
cd ..
cp -r "${GITHUB_REPOSITORY#*/}" "/tmp/wordpress/src/wp-content/plugins/${GITHUB_REPOSITORY#*/}"
cd /tmp/wordpress/
pwd
cp wp-tests-config-sample.php wp-tests-config.php
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
sed -i "s/yourusernamehere/root/" wp-tests-config.php
sed -i "s/yourpasswordhere/root/" wp-tests-config.php
- name: Creating database
run: |
sudo /etc/init.d/mysql start
mysql -u root -proot -e "CREATE DATABASE wordpress_tests;"
- name: Check Syntax
run: find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
- name: Run chromedriver
run: nohup $CHROMEWEBDRIVER/chromedriver --url-base=/wd/hub /dev/null 2>&1 &
- name: Codeception tests
run: |
cd "/tmp/wordpress/src/wp-content/plugins/${GITHUB_REPOSITORY#*/}"
pwd
composer phpunit