Repository navigation
124 lines (104 loc) · 3.36 KB
/
Copy pathci.yml
File metadata and controls
124 lines (104 loc) · 3.36 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
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
checks:
name: ${{ matrix.label }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- command: phpstan
label: PHPStan
- command: smoke
label: PHP smoke tests
steps:
- uses: actions/checkout@v7.0.1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
- name: Validate Composer metadata
run: composer validate --strict
- name: Install dependencies
run: composer install --no-interaction --prefer-dist
- name: Run ${{ matrix.label }}
run: composer ${{ matrix.command }}
workflow-contracts:
name: Workflow contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- name: Checkout Docs Agent producer
uses: actions/checkout@v7.0.1
with:
repository: Automattic/docs-agent
ref: 7b67d341eea16b75b8e055507d36a8d8e69a1fe3
path: .docs-agent-producer
- name: Checkout WP Codebox producer schema
uses: actions/checkout@v7.0.1
with:
repository: Automattic/wp-codebox
ref: a6fe2d208e990a8d04104aa74aacbb8d1539fbc1
path: .wp-codebox-producer
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: none
- name: Validate native Docs Agent producer contract
env:
DOCS_AGENT_DIR: ${{ github.workspace }}/.docs-agent-producer
WP_CODEBOX_DIR: ${{ github.workspace }}/.wp-codebox-producer
run: php tests/docs-agent-native-workflow-contract.php
- name: Lint GitHub Actions workflows
uses: docker://rhysd/actionlint:1.7.12
with:
# With no paths, actionlint discovers and reads every workflow file.
args: -no-color
option-store-concurrency:
name: Option-store concurrency
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:11.4
env:
MARIADB_DATABASE: agents_api_test
MARIADB_USER: agents_api
MARIADB_PASSWORD: agents_api
MARIADB_ROOT_PASSWORD: root
ports:
- 3306:3306
options: >-
--health-cmd="healthcheck.sh --connect --innodb_initialized"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v7.0.1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mysqli, pcntl
coverage: none
- name: Download WordPress database layer
run: |
curl --fail --silent --show-error https://wordpress.org/latest.tar.gz | tar -xz -C /tmp
- name: Run option-store concurrency tests
env:
AGENTS_API_WP_ROOT: /tmp/wordpress
AGENTS_API_DB_HOST: 127.0.0.1:3306
AGENTS_API_DB_NAME: agents_api_test
AGENTS_API_DB_USER: agents_api
AGENTS_API_DB_PASSWORD: agents_api
run: php tests/run-control-option-store-integration.php