Skip to content

Merge pull request #61 from TerrorSquad/release-please--branches--main #232

Merge pull request #61 from TerrorSquad/release-please--branches--main

Merge pull request #61 from TerrorSquad/release-please--branches--main #232

name: Integration Tests
on:
push:
branches: [main, develop]
paths:
- 'booster/**'
- 'tools/internal-test/**'
- '.github/workflows/integration-tests.yml'
pull_request:
branches: [main, develop]
paths:
- 'booster/**'
- 'tools/**'
- '.github/workflows/integration-tests.yml'
schedule:
# Run weekly on Sunday at 2 AM UTC
- cron: '0 2 * * 0'
workflow_dispatch:
inputs:
project_type:
description: 'Project type to test'
required: false
default: 'laravel'
type: choice
options:
- laravel
- symfony
test_action:
description: 'Test action to run'
required: false
default: 'full'
type: choice
options:
- full
- setup
- integrate
- verify
- test-hooks
jobs:
integration-test:
name: Integration Test (${{ matrix.project_type }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
project_type: [laravel, symfony]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v2
with:
cache: true
- name: Create cache directories
run: |
mkdir -p ~/.composer/cache
mkdir -p ~/.cache/composer
mkdir -p ~/.ddev/downloads
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: |
~/.composer/cache
~/.cache/composer
key: ${{ runner.os }}-composer-${{ matrix.project_type }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.project_type }}-
${{ runner.os }}-composer-
- name: Cache DDEV downloads
uses: actions/cache@v4
with:
path: ~/.ddev/downloads
key: ${{ runner.os }}-ddev-downloads-${{ matrix.project_type }}
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ matrix.project_type }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-${{ matrix.project_type }}-
${{ runner.os }}-pnpm-store-
- name: Install DDEV
uses: ddev/github-action-setup-ddev@v1
with:
autostart: false
- name: Configure DDEV
run: |
ddev config global --instrumentation-opt-in=false
ddev config global --omit-containers=ddev-ssh-agent
ddev version
- name: Check requirements
run: |
make test-env
- name: Run integration test
run: |
# Use manual input if workflow_dispatch, otherwise use matrix
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
PROJECT_TYPE="${{ github.event.inputs.project_type }}"
TEST_ACTION="${{ github.event.inputs.test_action }}"
else
PROJECT_TYPE="${{ matrix.project_type }}"
TEST_ACTION="full"
fi
echo "Running test: $TEST_ACTION for project type: $PROJECT_TYPE"
# Use Makefile targets for common actions
if [ "$TEST_ACTION" = "full" ]; then
if [ "$PROJECT_TYPE" = "laravel" ]; then
make test-laravel
elif [ "$PROJECT_TYPE" = "symfony" ]; then
make test-symfony
fi
elif [ "$TEST_ACTION" = "test-hooks" ]; then
make test-hooks
else
# For other actions, fall back to direct script call
./tools/internal-test/test-integration.py $TEST_ACTION $PROJECT_TYPE
fi
- name: Show test results
if: always()
run: |
echo "Test completed. Checking status..."
./tools/internal-test/test-integration.py status ${{ matrix.project_type }}
manual-test:
name: Manual Test (workflow_dispatch only)
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install mise
uses: jdx/mise-action@v2
with:
cache: true
- name: Create cache directories
run: |
mkdir -p ~/.composer/cache
mkdir -p ~/.cache/composer
mkdir -p ~/.ddev/downloads
- name: Cache Composer packages
uses: actions/cache@v4
with:
path: |
~/.composer/cache
~/.cache/composer
key: ${{ runner.os }}-composer-${{ github.event.inputs.project_type }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-${{ github.event.inputs.project_type }}-
${{ runner.os }}-composer-
- name: Cache DDEV downloads
uses: actions/cache@v4
with:
path: ~/.ddev/downloads
key: ${{ runner.os }}-ddev-downloads-${{ github.event.inputs.project_type }}
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ github.event.inputs.project_type }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-${{ github.event.inputs.project_type }}-
${{ runner.os }}-pnpm-store-
- name: Install DDEV
uses: ddev/github-action-setup-ddev@v1
with:
autostart: false
- name: Configure DDEV
run: |
ddev config global --instrumentation-opt-in=false
ddev config global --omit-containers=ddev-ssh-agent
ddev version
- name: Check requirements
run: |
make test-env
- name: Run manual test
run: |
PROJECT_TYPE="${{ github.event.inputs.project_type }}"
TEST_ACTION="${{ github.event.inputs.test_action }}"
echo "Running manual test: $TEST_ACTION for project type: $PROJECT_TYPE"
# Use Makefile targets for common actions
if [ "$TEST_ACTION" = "full" ]; then
if [ "$PROJECT_TYPE" = "laravel" ]; then
make test-laravel
elif [ "$PROJECT_TYPE" = "symfony" ]; then
make test-symfony
fi
elif [ "$TEST_ACTION" = "test-hooks" ]; then
make test-hooks
else
# For other actions, fall back to direct script call
./tools/internal-test/test-integration.py $TEST_ACTION $PROJECT_TYPE
fi
- name: Show test results
if: always()
run: |
echo "Manual test completed. Checking status..."
./tools/internal-test/test-integration.py status ${{ github.event.inputs.project_type }}