-
Notifications
You must be signed in to change notification settings - Fork 1
143 lines (125 loc) · 4.1 KB
/
ci.yml
File metadata and controls
143 lines (125 loc) · 4.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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