Skip to content

Commit 4a2cbd9

Browse files
committed
feat: add GitHub Actions integration testing
- Add comprehensive integration test workflow - Test both Laravel and Symfony projects - Support manual triggers with customizable options - Run automatically on push, PR, and weekly schedule - Update documentation to reflect GitHub Actions availability - Add integration test status badge to main README Closes: BLUEPRINT-001
1 parent 5eae7c5 commit 4a2cbd9

File tree

3 files changed

+175
-0
lines changed

3 files changed

+175
-0
lines changed
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
schedule:
9+
# Run weekly on Sunday at 2 AM UTC
10+
- cron: '0 2 * * 0'
11+
workflow_dispatch:
12+
inputs:
13+
project_type:
14+
description: 'Project type to test'
15+
required: false
16+
default: 'laravel'
17+
type: choice
18+
options:
19+
- laravel
20+
- symfony
21+
test_action:
22+
description: 'Test action to run'
23+
required: false
24+
default: 'full'
25+
type: choice
26+
options:
27+
- full
28+
- setup
29+
- integrate
30+
- verify
31+
- test-hooks
32+
33+
jobs:
34+
integration-test:
35+
name: Integration Test (${{ matrix.project_type }})
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
project_type: [laravel, symfony]
41+
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v4
48+
with:
49+
python-version: '3.11'
50+
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
54+
- name: Install DDEV
55+
run: |
56+
# Install DDEV
57+
curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null
58+
echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list
59+
sudo apt-get update
60+
sudo apt-get install -y ddev
61+
62+
# Configure DDEV
63+
ddev config global --instrumentation-opt-in=false
64+
ddev config global --omit-containers=ddev-ssh-agent
65+
66+
# Start DDEV
67+
ddev version
68+
69+
- name: Check requirements
70+
run: |
71+
./tools/internal-test/test-integration.py env-check
72+
73+
- name: Run integration test
74+
run: |
75+
# Use manual input if workflow_dispatch, otherwise use matrix
76+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
77+
PROJECT_TYPE="${{ github.event.inputs.project_type }}"
78+
TEST_ACTION="${{ github.event.inputs.test_action }}"
79+
else
80+
PROJECT_TYPE="${{ matrix.project_type }}"
81+
TEST_ACTION="full"
82+
fi
83+
84+
echo "Running test: $TEST_ACTION for project type: $PROJECT_TYPE"
85+
./tools/internal-test/test-integration.py $TEST_ACTION $PROJECT_TYPE ci-test-${{ github.run_number }}
86+
87+
- name: Show test results
88+
if: always()
89+
run: |
90+
echo "Test completed. Checking status..."
91+
./tools/internal-test/test-integration.py status || true
92+
93+
- name: Clean up test environment
94+
if: always()
95+
run: |
96+
echo "Cleaning up test environment..."
97+
./tools/internal-test/test-integration.py clean || true
98+
99+
# Additional cleanup for CI
100+
docker system prune -af || true
101+
ddev clean --all || true
102+
103+
manual-test:
104+
name: Manual Test (workflow_dispatch only)
105+
runs-on: ubuntu-latest
106+
if: github.event_name == 'workflow_dispatch'
107+
108+
steps:
109+
- name: Checkout code
110+
uses: actions/checkout@v4
111+
112+
- name: Set up Python
113+
uses: actions/setup-python@v4
114+
with:
115+
python-version: '3.11'
116+
117+
- name: Set up Docker Buildx
118+
uses: docker/setup-buildx-action@v3
119+
120+
- name: Install DDEV
121+
run: |
122+
# Install DDEV
123+
curl -fsSL https://apt.fury.io/drud/gpg.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/ddev.gpg > /dev/null
124+
echo "deb [signed-by=/etc/apt/trusted.gpg.d/ddev.gpg] https://apt.fury.io/drud/ * *" | sudo tee /etc/apt/sources.list.d/ddev.list
125+
sudo apt-get update
126+
sudo apt-get install -y ddev
127+
128+
# Configure DDEV
129+
ddev config global --instrumentation-opt-in=false
130+
ddev config global --omit-containers=ddev-ssh-agent
131+
132+
# Start DDEV
133+
ddev version
134+
135+
- name: Check requirements
136+
run: |
137+
./tools/internal-test/test-integration.py env-check
138+
139+
- name: Run manual test
140+
run: |
141+
PROJECT_TYPE="${{ github.event.inputs.project_type }}"
142+
TEST_ACTION="${{ github.event.inputs.test_action }}"
143+
144+
echo "Running manual test: $TEST_ACTION for project type: $PROJECT_TYPE"
145+
./tools/internal-test/test-integration.py $TEST_ACTION $PROJECT_TYPE manual-test-${{ github.run_number }}
146+
147+
- name: Show test results
148+
if: always()
149+
run: |
150+
echo "Manual test completed. Checking status..."
151+
./tools/internal-test/test-integration.py status || true
152+
153+
- name: Clean up test environment
154+
if: always()
155+
run: |
156+
echo "Cleaning up test environment..."
157+
./tools/internal-test/test-integration.py clean || true
158+
159+
# Additional cleanup for CI
160+
docker system prune -af || true
161+
ddev clean --all || true

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Booster
22

3+
[![Integration Tests](https://github.com/TerrorSquad/php-blueprint/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/TerrorSquad/php-blueprint/actions/workflows/integration-tests.yml)
4+
35
A curated collection of tools and best practices for PHP development.
46

57
## Key Features

tools/internal-test/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ Run the comprehensive Python test script for full end-to-end testing:
4343
- `laravel` (default)
4444
- `symfony`
4545

46+
## GitHub Actions
47+
48+
Integration tests are automatically run via GitHub Actions on:
49+
- Push to main/develop branches (tests both Laravel and Symfony)
50+
- Pull requests targeting main/develop (tests both Laravel and Symfony)
51+
- Weekly schedule (Sunday at 2 AM UTC)
52+
- Manual trigger from GitHub UI with customizable options:
53+
- Choose project type (Laravel or Symfony)
54+
- Choose test action (full, setup, integrate, verify, test-hooks)
55+
56+
The workflow uses the same Python test script and provides the same comprehensive testing in a CI environment.
57+
4658
## Test Features
4759

4860
The Python test script provides comprehensive verification:

0 commit comments

Comments
 (0)