-
Notifications
You must be signed in to change notification settings - Fork 85
73 lines (55 loc) · 2 KB
/
test-php.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
name: Test Suite
run-name: '[Test] ${{ github.event.head_commit.message }}'
on: [push, workflow_dispatch]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: ["wpunit", "acceptance"]
# wordpress: ["nightly", "6.4", "6.2"]
wordpress: ["6.4", "6.2"]
#php: ["8.0", "8.3"]
php: ["8.0"]
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- run: bun install --frozen-lockfile
# - run: bun rebuild && bun run prepare --if-present
- name: Build packages
run: bun run build
- name: Install composer
run: sudo composer self-update --stable
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
- name: Setup environment
run: envsubst < tests/docker-compose.codeception.env > tests/codeception.env
- name: Set WordPress Version
if: matrix.wordpress != 'nightly'
run: sed -i -e 's/WP_TAG=6/WP_TAG=${{ matrix.wordpress }}/g' .env
- name: Set WordPress Version
if: matrix.wordpress != 'nightly'
run: |
sed -i -e 's/WP_TAG=6-php8.0/WP_TAG=${{ matrix.wordpress }}-php${{ matrix.php }}/g' .env
sed -i -e 's/WP_VERSION=""/WP_VERSION="${{ matrix.wordpress }}"/g' tests/codeception.env
- name: Set WordPress Nightly
if: matrix.wordpress == 'nightly'
run: |
sed -i -e 's/WP_VERSION=""/WP_VERSION="nightly"/g' tests/codeception.env
- name: Setup docker
run: ./bin/setup-docker.sh
- name: Run tests
run: |
bun run test-build
bun run test-${{ matrix.test }}
- name: Upload codeception output
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: "${{ matrix.test }}-${{ matrix.wordpress }}-output"
path: "./tests/_output"