Skip to content

Commit 3ce5fc4

Browse files
mattmilesiclaude
andcommitted
ci: add GitHub Actions workflow with lowest/highest dependency matrix
Run Pest and PHPStan on PHP 8.2–8.5 against both the lowest and the highest dependency versions allowed by composer.json. composer.lock is not committed, so the lowest job is what actually proves the declared elephant-php ^0.2 || … || ^0.5 range (and neuron-ai ^3.0) still works. A separate job checks formatting with Pint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7201ce2 commit 3ce5fc4

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
tests:
13+
name: PHP ${{ matrix.php }} / ${{ matrix.dependencies }}
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
php: ['8.2', '8.3', '8.4', '8.5']
20+
dependencies: [lowest, highest]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
extensions: zip, dom, libxml
29+
coverage: none
30+
31+
# composer.lock is not committed, so "highest" resolves the newest
32+
# versions allowed by composer.json and "lowest" the oldest ones
33+
# (e.g. elephant-php 0.2.0), checking the whole declared range.
34+
- name: Install dependencies (${{ matrix.dependencies }})
35+
run: |
36+
if [ "${{ matrix.dependencies }}" = "lowest" ]; then
37+
composer update --prefer-lowest --prefer-stable --no-interaction --no-progress
38+
else
39+
composer update --prefer-stable --no-interaction --no-progress
40+
fi
41+
42+
- name: Tests
43+
run: composer test
44+
45+
- name: PHPStan
46+
run: composer stan -- --no-progress
47+
48+
lint:
49+
name: Pint
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- uses: shivammathur/setup-php@v2
56+
with:
57+
php-version: '8.4'
58+
coverage: none
59+
60+
- run: composer update --prefer-stable --no-interaction --no-progress
61+
62+
- run: ./vendor/bin/pint --test

0 commit comments

Comments
 (0)