-
Notifications
You must be signed in to change notification settings - Fork 8
37 lines (33 loc) · 1.13 KB
/
test.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
name: Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: PHP ${{ matrix.php-version }} / WP ${{ matrix.wp-version }}
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
wp-version: ['6.4.3', '6.3.5']
steps:
- uses: actions/checkout@v4
- name: Build and run tests
id: phpunit
shell: bash
run: |
{
echo "### PHP ${{ matrix.php-version }} / WordPress ${{ matrix.wp-version }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
docker compose build --build-arg PHP_VERSION=${{ matrix.php-version }} wordpress-test
WP_VERSION=${{ matrix.wp-version }} docker compose run --rm wordpress-test sh -c "composer install && ./vendor/bin/phpunit" | tee >(cat >> $GITHUB_STEP_SUMMARY)
exit ${PIPESTATUS[0]}
} || {
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
exit 1
}
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY