forked from wpengine/wp-graphql-content-blocks
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 2.06 KB
/
test-plugin.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
name: Test Plugin
on:
workflow_call:
pull_request:
paths-ignore:
- '**/*.md'
jobs:
test_plugin:
runs-on: ubuntu-22.04
strategy:
matrix:
php: [ '8.2', '7.4' ]
wordpress: [ '6.6','6.5', '6.4', '6.3', '6.2', '6.1' ]
exclude:
- php: 8.2
wordpress: 6.1
- php: 7.4
wordpress: 6.2
- php: 7.4
wordpress: 6.3
- php: 7.4
wordpress: 6.4
- php: 7.4
wordpress: 6.5
- php: 7.4
wordpress: 6.6
fail-fast: false
name: WordPress ${{ matrix.wordpress }}, PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Docker Containers
env:
PHP_VERSION: ${{ matrix.php }}
WP_VERSION: ${{ matrix.wordpress }}
working-directory: ./
run: |
docker compose build \
--build-arg WP_VERSION=${{ matrix.wordpress }} \
--build-arg PHP_VERSION=${{ matrix.php }}
docker compose up -d
- name: Wait for db
run: |
while ! mysqladmin ping --host=127.0.0.1 --port=33066 --password=$MYSQL_ROOT_PASSWORD --silent; do
sleep 1
done
- name: Setup testing framework
working-directory: ./
run: docker exec -e COVERAGE=1 $(docker compose ps -q wordpress) init-testing-environment.sh
- name: Install and activate WP GraphQL
working-directory: ./
run: docker exec --workdir=/var/www/html/wp-content/plugins/wp-graphql-content-blocks $(docker compose ps -q wordpress) wp plugin install wp-graphql --activate --allow-root
- name: Install Dependencies
working-directory: ./
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/wp-graphql-content-blocks $(docker compose ps -q wordpress) composer install
- name: Run unit tests
working-directory: ./
run: docker exec -e COVERAGE=1 -w /var/www/html/wp-content/plugins/wp-graphql-content-blocks $(docker compose ps -q wordpress) composer test