Skip to content

feat(lab-03): SuiteCRM Advanced Features -- Redis session cache, dedi… #7

feat(lab-03): SuiteCRM Advanced Features -- Redis session cache, dedi…

feat(lab-03): SuiteCRM Advanced Features -- Redis session cache, dedi… #7

Workflow file for this run

name: CI
on:
push:
branches: [main, develop, 'feature/**', 'bugfix/**']
pull_request:
branches: [main, develop]
permissions:
contents: read
security-events: write
jobs:
validate:
name: Validate Configuration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate Docker Compose files
run: |
for f in docker/docker-compose.*.yml; do
echo "Validating: $f"
docker compose -f "$f" config --no-interpolate -q
done
- name: ShellCheck — lab test scripts
run: |
sudo apt-get install -y shellcheck -qq
shellcheck tests/labs/*.sh
- name: Validate module manifest
run: |
python3 -c "
import sys, re
with open('it-stack-suitecrm.yml') as f:
content = f.read()
required = ['module:', 'version:', 'phase:', 'category:', 'ports:']
missing = [k for k in required if k not in content]
if missing:
print('Missing fields:', missing); sys.exit(1)
print('Manifest valid')
"
security-scan:
name: Security Scan
runs-on: ubuntu-latest
needs: validate
steps:
- uses: actions/checkout@v4
- name: Trivy — scan Dockerfile
uses: aquasecurity/trivy-action@0.28.0
with:
scan-type: config
scan-ref: .
exit-code: '0'
severity: CRITICAL,HIGH
- name: Trivy — SARIF output
uses: aquasecurity/trivy-action@0.28.0
with:
scan-type: config
scan-ref: .
format: sarif
output: trivy-results.sarif
- name: Upload SARIF to GitHub Security
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: trivy-results.sarif
lab-01-smoke:
name: Lab 01 -- SuiteCRM Standalone (MariaDB + CRM)
runs-on: ubuntu-latest
needs: validate
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get install -y curl
- name: Validate standalone compose
run: docker compose -f docker/docker-compose.standalone.yml config -q && echo "Standalone compose valid"
- name: Start standalone stack
run: docker compose -f docker/docker-compose.standalone.yml up -d
- name: Wait for MariaDB
run: timeout 120 bash -c 'until docker exec suitecrm-s01-db mysqladmin ping -h localhost -u root -pRootLab01! > /dev/null 2>&1; do sleep 5; done'
- name: Wait for SuiteCRM
run: timeout 300 bash -c 'until curl -sf http://localhost:8302/index.php | grep -qi suitecrm; do sleep 10; done'
- name: Run Lab 12-01 test script
run: bash tests/labs/test-lab-12-01.sh --no-cleanup
- name: Collect logs on failure
if: failure()
run: docker compose -f docker/docker-compose.standalone.yml logs
- name: Cleanup
if: always()
run: docker compose -f docker/docker-compose.standalone.yml down -v
lab-02-smoke:
name: Lab 02 -- SuiteCRM External Dependencies (MariaDB + Mailhog)
runs-on: ubuntu-latest
needs: validate
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get install -y curl default-mysql-client
- name: Validate LAN compose
run: docker compose -f docker/docker-compose.lan.yml config -q && echo "LAN compose valid"
- name: Start LAN stack
run: docker compose -f docker/docker-compose.lan.yml up -d
- name: Wait for MariaDB
run: timeout 120 bash -c 'until docker exec suitecrm-l02-db mysqladmin ping -uroot -pRootLab02! --silent; do sleep 5; done'
- name: Wait for Mailhog
run: timeout 60 bash -c 'until curl -sf http://localhost:8611/api/v2/messages; do sleep 5; done'
- name: Wait for SuiteCRM
run: timeout 300 bash -c 'until curl -sf http://localhost:8311/index.php; do sleep 10; done'
- name: Run Lab 12-02 test script
run: bash tests/labs/test-lab-12-02.sh --no-cleanup
- name: Collect logs on failure
if: failure()
run: docker compose -f docker/docker-compose.lan.yml logs
- name: Cleanup
if: always()
run: docker compose -f docker/docker-compose.lan.yml down -v
lab-03-smoke:
name: Lab 03 -- SuiteCRM Advanced Features (Redis sessions + dedicated Cron)
runs-on: ubuntu-latest
needs: validate
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install tools
run: sudo apt-get install -y curl default-mysql-client redis-tools
- name: Validate advanced compose
run: docker compose -f docker/docker-compose.advanced.yml config -q && echo "Advanced compose valid"
- name: Start advanced stack
run: docker compose -f docker/docker-compose.advanced.yml up -d
- name: Wait for MariaDB
run: timeout 120 bash -c 'until docker exec suitecrm-a03-db mysqladmin ping -uroot -pRootLab03! --silent; do sleep 5; done'
- name: Wait for Redis
run: timeout 30 bash -c 'until docker exec suitecrm-a03-redis redis-cli ping | grep -q PONG; do sleep 3; done'
- name: Wait for Mailhog
run: timeout 60 bash -c 'until curl -sf http://localhost:8621/api/v2/messages; do sleep 5; done'
- name: Wait for SuiteCRM
run: timeout 300 bash -c 'until curl -sf http://localhost:8321/index.php; do sleep 10; done'
- name: Run Lab 12-03 test script
run: bash tests/labs/test-lab-12-03.sh --no-cleanup
- name: Collect logs on failure
if: failure()
run: docker compose -f docker/docker-compose.advanced.yml logs
- name: Cleanup
if: always()
run: docker compose -f docker/docker-compose.advanced.yml down -v