Skip to content

[ADD] CI jobs for demo runtime proof and runtime integration with bra… #9

[ADD] CI jobs for demo runtime proof and runtime integration with bra…

[ADD] CI jobs for demo runtime proof and runtime integration with bra… #9

Workflow file for this run

name: CI
on:
push:
branches:
- '**'
pull_request:
workflow_dispatch:
inputs:
run_demo_runtime:
description: 'Run demo runtime proof (make demo-all + artifacts)'
required: false
default: false
type: boolean
run_runtime_integration:
description: 'Run runtime integration checks against deployed environment'
required: false
default: false
type: boolean
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
- name: Validate composer files
run: composer validate --strict
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Run CI checks
run: composer run ci:check
runtime-integration:
needs: checks
if: >-
${{
(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/'))
|| (github.event_name == 'workflow_dispatch' && inputs.run_runtime_integration == true)
}}
runs-on: ubuntu-latest
env:
EMCP_INTEGRATION_ENABLED: '1'
EMCP_BASE_URL: ${{ secrets.EMCP_BASE_URL }}
EMCP_SERVER_HANDLE: ${{ secrets.EMCP_SERVER_HANDLE }}
EMCP_API_PATH: ${{ secrets.EMCP_API_PATH }}
EMCP_API_TOKEN: ${{ secrets.EMCP_API_TOKEN }}
EMCP_MANAGER_PATH: ${{ secrets.EMCP_MANAGER_PATH }}
EMCP_MANAGER_COOKIE: ${{ secrets.EMCP_MANAGER_COOKIE }}
EMCP_DISPATCH_CHECK: ${{ secrets.EMCP_DISPATCH_CHECK }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Validate live runtime secrets
run: |
set -eu
missing=""
for var in EMCP_BASE_URL EMCP_SERVER_HANDLE EMCP_API_PATH EMCP_API_TOKEN; do
eval "value=\${$var:-}"
if [ -z "$value" ]; then
missing="$missing $var"
fi
done
if [ -n "$missing" ]; then
echo "Missing required secrets/env for runtime integration:$missing" >&2
exit 1
fi
- name: Runtime integration checks
run: |
set -eu
export EMCP_DISPATCH_CHECK="${EMCP_DISPATCH_CHECK:-1}"
composer run test:integration:runtime | tee runtime-live.log
- name: Upload runtime integration artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: runtime-live-log
path: runtime-live.log
if-no-files-found: warn
demo-runtime-proof:
needs: checks
if: >-
${{
(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/'))
|| (github.event_name == 'workflow_dispatch' && inputs.run_demo_runtime == true)
}}
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
DEMO_JWT_SECRET: emcp-demo-secret-0123456789abcdef0123456789abcdef
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
- name: Install dependencies
run: composer install --no-interaction --prefer-dist --no-progress
- name: Install Evolution installer
run: |
set -eu
composer global require evolution-cms/installer --no-interaction --no-progress
echo "$(composer global config bin-dir --absolute)" >> "$GITHUB_PATH"
- name: Run demo runtime proof
run: make demo-all
- name: Upload demo runtime artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: demo-runtime-artifacts
path: |
demo/logs.md
/tmp/emcp-demo-php-server.log
if-no-files-found: warn