Skip to content

Commit 3cc3891

Browse files
committed
chore(agent): gate and publish P3 from clean validated head
1 parent a6ac1b0 commit 3cc3891

1 file changed

Lines changed: 177 additions & 13 deletions

File tree

‎.github/workflows/agent-p3-control-e2e.yml‎

Lines changed: 177 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,16 @@ jobs:
4242
version: '6.8.3'
4343
cache: true
4444

45-
- name: Configure simulator
46-
run: cmake -S apps/ied_simulator -B build-p3e-qt -G Ninja -DCMAKE_BUILD_TYPE=Release
47-
4845
- name: Build simulator and probes
49-
run: cmake --build build-p3e-qt --target arstack_ied_simulator ariec61850_mms_read_probe ariec61850_static_rcb_trial --parallel 2
50-
51-
- name: Configure control profile
52-
run: cmake -S tools/mms_direct_control_server -B build-p3e-control -G Ninja -DCMAKE_BUILD_TYPE=Release
53-
54-
- name: Build control probe and unit
55-
run: cmake --build build-p3e-control --target ariec61850_mms_control_interop_client ariec61850_mms_direct_control_tests --parallel 2
46+
run: |
47+
cmake -S apps/ied_simulator -B build-p3e-qt -G Ninja -DCMAKE_BUILD_TYPE=Release
48+
cmake --build build-p3e-qt --target arstack_ied_simulator ariec61850_mms_read_probe ariec61850_static_rcb_trial --parallel 2
5649
57-
- name: Static direct control unit
58-
run: ctest --test-dir build-p3e-control -R mms_direct_control_unit --output-on-failure
50+
- name: Build control probe and strict unit
51+
run: |
52+
cmake -S tools/mms_direct_control_server -B build-p3e-control -G Ninja -DCMAKE_BUILD_TYPE=Release
53+
cmake --build build-p3e-control --target ariec61850_mms_control_interop_client ariec61850_mms_direct_control_tests --parallel 2
54+
ctest --test-dir build-p3e-control -R mms_direct_control_unit --output-on-failure
5955
6056
- name: P3 live four-model control matrix
6157
run: |
@@ -76,7 +72,7 @@ jobs:
7672
--report-probe build-p3e-qt \
7773
--scl tests/fixtures/scl/iedsim-full-model.scd
7874
79-
- name: Commit validated P3 product source
75+
- name: Persist validated P3 product source when needed
8076
run: |
8177
git config user.name openai-agent
8278
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
@@ -92,3 +88,171 @@ jobs:
9288
git commit -m 'fix(iedsim): harden hosted control runtime and QA selection'
9389
git push origin HEAD:agent/p3-control-e2e
9490
fi
91+
92+
clean-linux-gates:
93+
needs: p3-live-control
94+
runs-on: ubuntu-24.04
95+
outputs:
96+
clean_sha: ${{ steps.clean.outputs.sha }}
97+
steps:
98+
- uses: actions/checkout@v4
99+
with:
100+
ref: agent/p3-control-e2e
101+
fetch-depth: 0
102+
103+
- name: Guard main and PR source head
104+
run: |
105+
set -euo pipefail
106+
EXPECTED_MAIN=75df1edbf631c7e3f67318bfc56cdcaf1c504c05
107+
EXPECTED_TARGET=4e243e9abeef812859203de664738e6a3110597c
108+
MAIN=$(git ls-remote origin refs/heads/main | awk '{print $1}')
109+
TARGET=$(git ls-remote origin refs/heads/agent/iedsim-full-scl-live-store | awk '{print $1}')
110+
test "$MAIN" = "$EXPECTED_MAIN"
111+
test "$TARGET" = "$EXPECTED_TARGET"
112+
113+
- name: Construct single clean P3 commit on P2
114+
id: clean
115+
run: |
116+
set -euo pipefail
117+
SOURCE=$(git rev-parse HEAD)
118+
BASE=4e243e9abeef812859203de664738e6a3110597c
119+
git switch --detach "$BASE"
120+
git switch -C agent/p3-clean-staging
121+
files=(
122+
CMakeLists.txt
123+
apps/ied_simulator/CMakeLists.txt
124+
apps/ied_simulator/src/IedSimulatorController.cpp
125+
apps/ied_simulator/src/IedSimulatorController.hpp
126+
apps/ied_simulator/src/SclMmsMaterializer.hpp
127+
apps/ied_simulator/src/main.cpp
128+
apps/ied_simulator/test_control_live.py
129+
apps/ied_simulator/test_gui_live_value.py
130+
include/ariec61850/mms/static_object_table.hpp
131+
src/mms/static_object_table.cpp
132+
src/mms/static_dispatcher.cpp
133+
tests/fixtures/scl/iedsim-full-model.scd
134+
tools/static_ied_server.cpp
135+
tools/static_ied_server_iedsim/CMakeLists.txt
136+
)
137+
git checkout "$SOURCE" -- "${files[@]}"
138+
git diff --check
139+
git config user.name openai-agent
140+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
141+
git add "${files[@]}"
142+
git commit -m 'feat(iedsim): integrate guarded IEC 61850 controls'
143+
CLEAN=$(git rev-parse HEAD)
144+
git push --force origin HEAD:refs/heads/agent/p3-clean-staging
145+
echo "sha=$CLEAN" >> "$GITHUB_OUTPUT"
146+
echo "P3_CLEAN_SHA=$CLEAN"
147+
148+
- name: Install Qt for clean-head E2E
149+
uses: jurplel/install-qt-action@v4
150+
with:
151+
version: '6.8.3'
152+
cache: true
153+
154+
- name: Clean-head P3 and P0-P2 live E2E
155+
run: |
156+
cmake -S apps/ied_simulator -B build-clean-qt -G Ninja -DCMAKE_BUILD_TYPE=Release
157+
cmake --build build-clean-qt --target arstack_ied_simulator ariec61850_mms_read_probe ariec61850_static_rcb_trial --parallel 2
158+
cmake -S tools/mms_direct_control_server -B build-clean-control -G Ninja -DCMAKE_BUILD_TYPE=Release
159+
cmake --build build-clean-control --target ariec61850_mms_control_interop_client ariec61850_mms_direct_control_tests --parallel 2
160+
ctest --test-dir build-clean-control -R mms_direct_control_unit --output-on-failure
161+
APP=$(find build-clean-qt -type f -name arstack_ied_simulator -perm -111 | head -1)
162+
python3 apps/ied_simulator/test_control_live.py \
163+
--app "$APP" \
164+
--read-probe build-clean-qt \
165+
--control-probe build-clean-control \
166+
--scl tests/fixtures/scl/iedsim-full-model.scd
167+
python3 apps/ied_simulator/test_gui_live_value.py \
168+
--app "$APP" \
169+
--read-probe build-clean-qt \
170+
--report-probe build-clean-qt \
171+
--scl tests/fixtures/scl/iedsim-full-model.scd
172+
173+
- name: Control hard profiles GCC and Clang
174+
run: |
175+
set -euo pipefail
176+
for toolchain in 'gcc:g++' 'clang:clang++'; do
177+
IFS=: read -r CC_BIN CXX_BIN <<< "$toolchain"
178+
tag=${CC_BIN%%-*}
179+
CC=$CC_BIN CXX=$CXX_BIN cmake -S . -B "build-guarded-$tag" -G Ninja \
180+
-DCMAKE_BUILD_TYPE=Release \
181+
-DARIEC61850_BUILD_TESTS=OFF \
182+
-DARIEC61850_BUILD_TOOLS=OFF \
183+
-DARIEC61850_BUILD_EMBEDDED_PROFILE=ON
184+
cmake --build "build-guarded-$tag" --target ariec61850_embedded_control_guarded_hard_profile --parallel 2
185+
"./build-guarded-$tag/embedded/ariec61850_embedded_control_guarded_hard_profile"
186+
187+
CC=$CC_BIN CXX=$CXX_BIN cmake -S tests/control_mms_profile -B "build-control-mms-$tag" -G Ninja -DCMAKE_BUILD_TYPE=Release
188+
cmake --build "build-control-mms-$tag" --parallel 2
189+
ctest --test-dir "build-control-mms-$tag" --output-on-failure
190+
191+
CC=$CC_BIN CXX=$CXX_BIN cmake -S tests/control_session_profile -B "build-control-session-$tag" -G Ninja -DCMAKE_BUILD_TYPE=Release
192+
cmake --build "build-control-session-$tag" --parallel 2
193+
ctest --test-dir "build-control-session-$tag" --output-on-failure
194+
195+
CC=$CC_BIN CXX=$CXX_BIN cmake -S tests/control_termination_profile -B "build-control-term-$tag" -G Ninja -DCMAKE_BUILD_TYPE=Release
196+
cmake --build "build-control-term-$tag" --parallel 2
197+
ctest --test-dir "build-control-term-$tag" --output-on-failure
198+
done
199+
200+
- name: Embedded host-sim boundary GCC and Clang
201+
run: |
202+
set -euo pipefail
203+
CC=gcc CXX=g++ cmake -S embedded -B build-embedded-gcc -G Ninja -DCMAKE_BUILD_TYPE=Release
204+
cmake --build build-embedded-gcc --parallel 2
205+
ctest --test-dir build-embedded-gcc --output-on-failure
206+
CC=clang CXX=clang++ cmake -S embedded -B build-embedded-clang -G Ninja -DCMAKE_BUILD_TYPE=Release
207+
cmake --build build-embedded-clang --parallel 2
208+
ctest --test-dir build-embedded-clang --output-on-failure
209+
210+
- name: IEDScout parity server GCC and Clang
211+
run: |
212+
set -euo pipefail
213+
CC=gcc CXX=g++ cmake -S tools/static_ied_server_iedsim -B build-parity-gcc -G Ninja -DCMAKE_BUILD_TYPE=Release
214+
cmake --build build-parity-gcc --parallel 2
215+
ctest --test-dir build-parity-gcc --output-on-failure
216+
CC=clang CXX=clang++ cmake -S tools/static_ied_server_iedsim -B build-parity-clang -G Ninja -DCMAKE_BUILD_TYPE=Release
217+
cmake --build build-parity-clang --parallel 2
218+
ctest --test-dir build-parity-clang --output-on-failure
219+
220+
clean-windows-parity:
221+
needs: clean-linux-gates
222+
runs-on: windows-latest
223+
steps:
224+
- uses: actions/checkout@v4
225+
with:
226+
ref: ${{ needs.clean-linux-gates.outputs.clean_sha }}
227+
- name: IEDScout parity server Windows
228+
shell: pwsh
229+
run: |
230+
cmake -S tools/static_ied_server_iedsim -B build-parity -DCMAKE_BUILD_TYPE=Release
231+
cmake --build build-parity --config Release --parallel 2
232+
ctest --test-dir build-parity -C Release --output-on-failure
233+
234+
publish-pr-head:
235+
needs: [clean-linux-gates, clean-windows-parity]
236+
runs-on: ubuntu-24.04
237+
steps:
238+
- uses: actions/checkout@v4
239+
with:
240+
ref: ${{ needs.clean-linux-gates.outputs.clean_sha }}
241+
fetch-depth: 0
242+
- name: Atomic ref guard and publish
243+
env:
244+
CLEAN_SHA: ${{ needs.clean-linux-gates.outputs.clean_sha }}
245+
run: |
246+
set -euo pipefail
247+
EXPECTED_MAIN=75df1edbf631c7e3f67318bfc56cdcaf1c504c05
248+
EXPECTED_TARGET=4e243e9abeef812859203de664738e6a3110597c
249+
MAIN=$(git ls-remote origin refs/heads/main | awk '{print $1}')
250+
TARGET=$(git ls-remote origin refs/heads/agent/iedsim-full-scl-live-store | awk '{print $1}')
251+
STAGING=$(git ls-remote origin refs/heads/agent/p3-clean-staging | awk '{print $1}')
252+
test "$MAIN" = "$EXPECTED_MAIN"
253+
test "$TARGET" = "$EXPECTED_TARGET"
254+
test "$STAGING" = "$CLEAN_SHA"
255+
git push origin \
256+
"$CLEAN_SHA:refs/heads/agent/iedsim-full-scl-live-store" \
257+
--force-with-lease=refs/heads/agent/iedsim-full-scl-live-store:$EXPECTED_TARGET
258+
echo "IEDSIM_P3_CLEAN_HEAD_PUBLISHED sha=$CLEAN_SHA"

0 commit comments

Comments
 (0)