Skip to content

Commit e95660b

Browse files
author
André Lange
committed
fix: resolve port 3306 conflict in GitHub Actions CI
- Remove obsolete `version` attribute from docker-compose.yml - Use MYSQL_PORT=3307 in CI (GH Actions has MySQL on 3306 by default) - Add --skip-docker-start flag to setup.sh for CI use - Run full setup.sh in CI instead of manual wp-cli calls
1 parent 8393752 commit e95660b

3 files changed

Lines changed: 24 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,28 @@ jobs:
1919
2020
- name: Start environment
2121
run: |
22-
docker compose up -d
23-
sleep 30 # Wait for services to start
22+
# GitHub Actions has MySQL on 3306 — use 3307 in CI
23+
echo "MYSQL_PORT=3307" >> .env
24+
docker compose up -d --wait
25+
docker compose ps
2426
2527
- name: Check service status
2628
run: |
27-
docker compose ps
2829
curl -f http://localhost:8082/ || echo "WordPress not ready"
29-
30-
- name: Install plugins
30+
31+
- name: Install and setup WordPress
3132
run: |
32-
chmod +x install-plugins.sh
33-
./install-plugins.sh
33+
chmod +x scripts/setup.sh
34+
./scripts/setup.sh --skip-docker-start
3435
3536
- name: Run WordPress health check
3637
run: |
3738
chmod +x tests/test-wordpress-health.sh
38-
./tests/test-wordpress-health.sh || echo "Health check failed, continuing..."
39-
40-
- name: Run example plugin API test (demonstration)
39+
./tests/test-wordpress-health.sh
40+
41+
- name: Verify REST API
4142
run: |
42-
# This demonstrates the test framework without requiring a specific plugin
43-
echo "Running demonstration test..."
44-
curl -f http://localhost:8082/wp-json/ || echo "WordPress REST API not accessible"
43+
curl -fsS http://localhost:8082/wp-json/
4544
4645
- name: Stop environment
4746
if: always()

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.8'
2-
31
# ────────────────────────────────────────────────────────────────────────────
42
# WordPress Testing Environment
53
# ────────────────────────────────────────────────────────────────────────────

scripts/setup.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# Usage:
66
# ./scripts/setup.sh # Full setup (Docker + WP + plugins)
77
# ./scripts/setup.sh --skip-plugins # Skip plugin installation
8-
# ./scripts/setup.sh --fresh # Destroy volumes and start fresh
8+
# ./scripts/setup.sh --fresh # Destroy volumes and start fresh
9+
# ./scripts/setup.sh --skip-docker-start # Skip Docker start (containers already running)
910
#
1011
# Requirements: Docker with Compose v2 plugin
1112
# =============================================================================
@@ -19,14 +20,16 @@ ENV_FILE="${ROOT_DIR}/.env"
1920
COMPOSE_CMD="docker compose"
2021
SKIP_PLUGINS=false
2122
FRESH_START=false
23+
SKIP_DOCKER_START=false
2224

2325
# ── Args ────────────────────────────────────────────────────────────────────
2426
for arg in "$@"; do
2527
case $arg in
26-
--skip-plugins) SKIP_PLUGINS=true ;;
27-
--fresh) FRESH_START=true ;;
28+
--skip-plugins) SKIP_PLUGINS=true ;;
29+
--fresh) FRESH_START=true ;;
30+
--skip-docker-start) SKIP_DOCKER_START=true ;;
2831
-h|--help)
29-
echo "Usage: $0 [--skip-plugins] [--fresh]"
32+
echo "Usage: $0 [--skip-plugins] [--fresh] [--skip-docker-start]"
3033
exit 0
3134
;;
3235
esac
@@ -281,7 +284,11 @@ show_summary() {
281284
main() {
282285
check_prereqs
283286
load_env
284-
start_containers
287+
if $SKIP_DOCKER_START; then
288+
info "Skipping Docker start (--skip-docker-start)"
289+
else
290+
start_containers
291+
fi
285292
install_wordpress
286293
install_plugins
287294
install_bundles

0 commit comments

Comments
 (0)