Skip to content

Commit 235373f

Browse files
committed
Add GitHub workflow to build and validate PHP 8.4 with MongoDB
- Builds Docker image for amazon-linux-2023-v84 - Validates PHP version - Validates MongoDB extension is loaded and functional - Triggers on changes to v84 files or workflow dispatch
1 parent 193a3db commit 235373f

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/build-v84.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build PHP 8.4
2+
3+
on:
4+
push:
5+
paths:
6+
- 'libs/amazon-linux-2023-v84/**'
7+
- '.github/workflows/build-v84.yml'
8+
pull_request:
9+
paths:
10+
- 'libs/amazon-linux-2023-v84/**'
11+
- '.github/workflows/build-v84.yml'
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Docker Buildx
22+
uses: docker/setup-buildx-action@v3
23+
24+
- name: Build Docker image
25+
working-directory: libs/amazon-linux-2023-v84
26+
run: make build
27+
28+
- name: Start container
29+
run: |
30+
docker run -d --name php84-test libphp/amazon-linux-2023-v84 sleep 300
31+
32+
- name: Validate PHP version
33+
run: |
34+
docker exec php84-test /usr/bin/php -v
35+
36+
- name: Validate MongoDB extension is loaded
37+
run: |
38+
docker exec php84-test /usr/bin/php -m | grep -q mongodb
39+
echo "MongoDB extension is available"
40+
41+
- name: Validate MongoDB extension details
42+
run: |
43+
docker exec php84-test /usr/bin/php -i | grep -A5 "mongodb"
44+
45+
- name: Test MongoDB extension functionality
46+
run: |
47+
docker exec php84-test /usr/bin/php -r "echo 'MongoDB version: ' . phpversion('mongodb') . PHP_EOL;"
48+
49+
- name: Cleanup
50+
if: always()
51+
run: |
52+
docker rm -f php84-test || true

0 commit comments

Comments
 (0)