Repository navigation
Bench checkpoint: M3C.5 hardware timestamp AUTO-local qualification #295
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/test_sv_tx_egress_evidence.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 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| 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' | |
| # Keep explicit MSVC targets in sync with the canonical CTest | |
| # registrations; CTest otherwise fails with missing M3 binaries. | |
| Build-Target 'ptp_control_cancellation_tests' | |
| Build-Target 'ptp_emac_role_ownership_tests' | |
| Build-Target 'ptp_canonical_authority_tests' | |
| Build-Target 'ptp_receiver_clock_authority_tests' | |
| Build-Target 'sv_ptp_clock_lease_tests' | |
| Build-Target 'sv_ptp_epoch_tests' | |
| Build-Target 'sv_ptp_phase_authority_tests' | |
| Build-Target 'sv_tx_egress_evidence_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 |