Skip to content

M2A: bounded continuous PTP–SMV phase authority and guarded ESP32-P4 observer #249

M2A: bounded continuous PTP–SMV phase authority and guarded ESP32-P4 observer

M2A: bounded continuous PTP–SMV phase authority and guarded ESP32-P4 observer #249

Workflow file for this run

name: PTP Core CI
on:
push:
branches: [main]
paths:
- 'include/ariec61850/time_sync/**'
- 'src/time_sync/**'
- 'include/ariec61850/ethernet/**'
- 'src/ethernet/**'
- 'include/ariec61850/sampled_values/wire_field_offsets.hpp'
- 'src/capture/pcap.cpp'
- 'tools/ptp_analyze.cpp'
- 'tests/test_ptp.cpp'
- 'tests/test_ptp_runtime.cpp'
- 'tests/test_ptp_power_profile.cpp'
- 'tests/test_smp_synch_policy.cpp'
- 'tests/test_smp_synch_wire_offset.cpp'
- 'tests/test_ptp_discipline.cpp'
- 'tests/test_ptp_p2_hardening.cpp'
- 'tests/test_sv_ptp_epoch.cpp'
- 'tests/test_sv_ptp_phase_authority.cpp'
- 'tests/ptp_profile/**'
- '.github/workflows/ptp-core-ci.yml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'include/ariec61850/time_sync/**'
- 'src/time_sync/**'
- 'include/ariec61850/ethernet/**'
- 'src/ethernet/**'
- 'include/ariec61850/sampled_values/wire_field_offsets.hpp'
- 'src/capture/pcap.cpp'
- 'tools/ptp_analyze.cpp'
- 'tests/test_ptp.cpp'
- 'tests/test_ptp_runtime.cpp'
- 'tests/test_ptp_power_profile.cpp'
- 'tests/test_smp_synch_policy.cpp'
- 'tests/test_smp_synch_wire_offset.cpp'
- 'tests/test_ptp_discipline.cpp'
- 'tests/test_ptp_p2_hardening.cpp'
- 'tests/test_sv_ptp_epoch.cpp'
- 'tests/test_sv_ptp_phase_authority.cpp'
- 'tests/ptp_profile/**'
- '.github/workflows/ptp-core-ci.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
portable-ptp:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure strict PTP profile
shell: bash
run: |
if [ "${{ matrix.compiler }}" = "clang" ]; then
export CC=clang
export CXX=clang++
else
export CC=gcc
export CXX=g++
fi
cmake -S tests/ptp_profile -B build-ptp-${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=Release
- name: Build strict PTP profile
shell: bash
run: cmake --build build-ptp-${{ matrix.compiler }} --parallel
- name: Run PTP regression tests
shell: bash
run: ctest --test-dir build-ptp-${{ matrix.compiler }} --output-on-failure
portable-ptp-msvc:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure standalone strict MSVC PTP profile
shell: pwsh
run: cmake -S tests/ptp_profile -B build-ptp-msvc -A x64
- name: Build PTP core and analyzer with diagnostics
shell: pwsh
run: |
function Build-Target([string]$Target) {
$output = & cmake --build build-ptp-msvc --config Release --target $Target --parallel 2>&1
$status = $LASTEXITCODE
$output | Tee-Object -FilePath "ptp-msvc-$Target.log"
if ($status -ne 0) {
$matched = $false
foreach ($line in $output) {
$text = "$line"
if ($text -match '(?i)(error C\d+|fatal error|error LNK\d+|error MSB\d+|: error )') {
$matched = $true
$escaped = $text.Replace('%','%25').Replace("`r",'%0D').Replace("`n",'%0A')
Write-Output "::error title=MSVC $Target::$escaped"
}
}
if (-not $matched) {
Write-Output "::error title=MSVC $Target::Build failed; inspect ptp-msvc-$Target.log in the job output."
}
exit $status
}
}
Build-Target 'ptp_profile_core'
Build-Target 'ptp_profile_tests'
Build-Target 'ptp_runtime_tests'
Build-Target 'ptp_power_profile_tests'
Build-Target 'smp_synch_policy_tests'
Build-Target 'smp_synch_wire_offset_tests'
Build-Target 'ptp_discipline_tests'
Build-Target 'sv_ptp_epoch_tests'
Build-Target 'sv_ptp_phase_authority_tests'
Build-Target 'ptp_p2_hardening_tests'
Build-Target 'ptp_profile_analyze'
- name: Run PTP regression and analyzer smoke tests on MSVC
shell: pwsh
run: ctest --test-dir build-ptp-msvc -C Release --output-on-failure