-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (121 loc) · 4.15 KB
/
ci.yml
File metadata and controls
149 lines (121 loc) · 4.15 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
# Opt into Node 24 ahead of the June 2026 default flip.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
tests:
name: Tests (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.3', '8.4']
services:
redis:
image: redis:7-alpine
ports: ['6379:6379']
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
memcached:
image: memcached:1.6-alpine
ports: ['11211:11211']
mongo:
image: mongo:7
ports: ['27017:27017']
options: >-
--health-cmd "mongosh --quiet --eval 'db.runCommand({ ping: 1 }).ok'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, json, mbstring, openssl, memcached, redis, mongodb
coverage: xdebug
tools: composer:v2
ini-values: memory_limit=-1, date.timezone=UTC
- name: Validate composer.json
run: composer validate --strict --no-check-lock
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Run tests
run: vendor/bin/phpunit --coverage-clover coverage.xml
- name: Upload coverage to Codecov
if: matrix.php == '8.3'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
static-analysis:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: intl, json, mbstring, openssl
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Run PHPStan
run: vendor/bin/phpstan analyse --no-progress --memory-limit=1G
- name: Check code style
run: vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no
- name: Rector dry-run
run: vendor/bin/rector process --dry-run
determinism:
name: Determinism gate (#74)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: intl, json, mbstring, openssl
coverage: none
tools: composer:v2
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
# The byte-stability gate: regenerate the framework's own committed
# generated content, then assert that nothing changed. A non-empty
# `git diff` here means an emitter is non-deterministic — agents
# would see phantom drift, which is the failure mode #74 prevents.
- name: Regenerate manifests
run: php bin/altair manifest:generate
- name: Assert .agent/ is byte-stable
run: |
if ! git diff --exit-code .agent/; then
echo "::error::Generated content under .agent/ changed after regeneration." \
"An emitter is non-deterministic; see AGENT.md §5 for the standard."
exit 1
fi