-
-
Notifications
You must be signed in to change notification settings - Fork 37
105 lines (92 loc) · 2.59 KB
/
acceptance-tests.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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
name: Acceptance Tests
on:
push:
branches:
- 'develop'
- 'trunk'
- 'master'
pull_request:
branches:
- '**'
# Once weekly on Wednesdays at 16:00 UTC.
schedule:
- cron: '0 16 * * 3'
workflow_dispatch:
jobs:
acceptance:
strategy:
matrix:
wp: ['6.4','5.6','nightly']
php: ['8.0','7.4']
include:
- wp: '6.4'
php: '8.1'
- wp: 'nightly'
php: '8.1'
- wp: '6.4'
php: '8.2'
- wp: 'nightly'
php: '8.2'
fail-fast: false
name: WP ${{ matrix.wp }} / PHP ${{ matrix.php }}
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
env:
LOCAL_PHP: ${{ matrix.php }}
LOCAL_WP_DEBUG: 1
steps:
- name: Matrix values
run: echo "${{ toJSON(matrix) }}"
- name: Checkout repository
uses: actions/checkout@v3
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Composer cache
uses: actions/cache@v3
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: 8.0-composer-${{ hashFiles('composer.json') }}
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
tools: composer:2.2
coverage: none
ini-file: development
env:
fail-fast: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Debugging
run: |
php --version
composer --version
docker --version
docker-compose --version
- name: Install dependencies
run: |
if [ "${{ matrix.wp }}" == "nightly" ]
then
composer require --dev --update-with-dependencies --prefer-dist roots/wordpress-full="dev-main"
else
composer require --dev --update-with-dependencies --prefer-dist roots/wordpress-full="~${{ matrix.wp }}.0"
fi
- name: Start Docker environment
run: composer test:start
- name: Log running Docker containers
run: docker ps -a
- name: Debug WordPress version
run: docker-compose run --rm wpcli wp core version
- name: Run the tests
run: composer test:acceptance
- name: Upload test artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: acceptance-wp-${{ matrix.wp }}-php-${{ matrix.php }}
path: tests/_output