|
7 | 7 | # |
8 | 8 | # edg-docker-test --posture=extensive --non-interactive |
9 | 9 | # |
10 | | -# inside the edgcpp/ci-runner image. Jobs are staged so GitHub can schedule |
| 10 | +# inside the ghcr.io/edgcpp/ci-runner image. Jobs are staged so GitHub can schedule |
11 | 11 | # them in parallel, with each test leg waiting only on its own build (and the |
12 | 12 | # shared timestamp, which runs alongside the builds): |
13 | 13 | # |
14 | 14 | # prepare ───────────────┬──► test-gcc ──┐ |
15 | 15 | # build-gcc ─────────────┘ ├──► publish (on failure) |
16 | 16 | # prepare ───────────────┬──► test-i686 ──┘ |
17 | 17 | # build-i686 ────────────┘ |
| 18 | +# bench (pull requests only; independent) |
18 | 19 | # |
19 | 20 | # A shared run timestamp keeps results under the same tests/runs/<timestamp>/ |
20 | 21 | # tree; the publish job republishes failure artifacts from all test legs. |
| 22 | +# The bench job runs the cachegrind benchmarks the way |
| 23 | +# `edg-docker-bench --posture=release` does and uploads them as bench-results |
| 24 | +# (c/ and cpp/ runs, for comparison against the checked-in |
| 25 | +# benchmarks/baselines/project/release-{c,cpp}). |
21 | 26 |
|
22 | 27 | name: Build & Test CI |
23 | 28 |
|
|
46 | 51 | runs-on: ubuntu-latest |
47 | 52 | timeout-minutes: 120 |
48 | 53 | container: |
49 | | - image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c |
| 54 | + image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8 |
50 | 55 | defaults: |
51 | 56 | run: |
52 | 57 | shell: edg-container-exec "bash -eo pipefail {0}" |
|
87 | 92 | runs-on: ubuntu-latest |
88 | 93 | timeout-minutes: 120 |
89 | 94 | container: |
90 | | - image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c |
| 95 | + image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8 |
91 | 96 | defaults: |
92 | 97 | run: |
93 | 98 | shell: edg-container-exec "bash -eo pipefail {0}" |
@@ -134,7 +139,7 @@ jobs: |
134 | 139 | - edg_x86_64 |
135 | 140 | - edg_x86_64_cp |
136 | 141 | container: |
137 | | - image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c |
| 142 | + image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8 |
138 | 143 | # Required for setarch ... -R (disable ASLR) used by the test harness. |
139 | 144 | options: --privileged |
140 | 145 | defaults: |
@@ -202,7 +207,7 @@ jobs: |
202 | 207 | - edg_x86_32 |
203 | 208 | - edg_x86_32_cp |
204 | 209 | container: |
205 | | - image: docker.io/edgcpp/ci-runner@sha256:73be12d128b8507f5feb9e73c25f48f14e6b041940ef165bce5fda8efe2b605c |
| 210 | + image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8 |
206 | 211 | # Required for setarch ... -R (disable ASLR) used by the test harness. |
207 | 212 | options: --privileged |
208 | 213 | defaults: |
@@ -277,10 +282,100 @@ jobs: |
277 | 282 | path: aggregated-test-results |
278 | 283 | merge-multiple: true |
279 | 284 |
|
| 285 | + # Record which commit was tested so consumers of the artifact (e.g. |
| 286 | + # acknowledg-forge) can check out the matching tree. For pull requests |
| 287 | + # this is the merge commit, not the PR head. |
| 288 | + - name: Record CI metadata |
| 289 | + env: |
| 290 | + TESTED_SHA: ${{ github.sha }} |
| 291 | + HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} |
| 292 | + RUN_ID: ${{ github.run_id }} |
| 293 | + RUN_ATTEMPT: ${{ github.run_attempt }} |
| 294 | + run: | |
| 295 | + python3 - > aggregated-test-results/ci-meta.json <<'EOF' |
| 296 | + import json, os |
| 297 | + print(json.dumps({ |
| 298 | + 'tested_sha': os.environ['TESTED_SHA'], |
| 299 | + 'head_sha': os.environ['HEAD_SHA'], |
| 300 | + 'run_id': int(os.environ['RUN_ID']), |
| 301 | + 'run_attempt': int(os.environ['RUN_ATTEMPT']), |
| 302 | + }, indent = 2)) |
| 303 | + EOF |
| 304 | +
|
280 | 305 | - name: Upload elist, elog, and .rt.tar.gz results |
281 | 306 | uses: actions/upload-artifact@v7 |
282 | 307 | with: |
283 | 308 | name: test-results-all |
284 | 309 | path: aggregated-test-results/ |
285 | 310 | if-no-files-found: warn |
286 | 311 | retention-days: 14 |
| 312 | + |
| 313 | + bench: |
| 314 | + name: Benchmark linux-gcc-release |
| 315 | + if: ${{ github.event_name == 'pull_request' }} |
| 316 | + # Benchmark infrastructure problems shouldn't fail a pull request's CI. |
| 317 | + continue-on-error: true |
| 318 | + runs-on: ubuntu-latest |
| 319 | + timeout-minutes: 120 |
| 320 | + container: |
| 321 | + image: ghcr.io/edgcpp/ci-runner@sha256:14b3948c2ce12cfa5472e5a6c468393d15426f3a67685cc35d830ea5db2acdf8 |
| 322 | + defaults: |
| 323 | + run: |
| 324 | + shell: edg-container-exec "bash -eo pipefail {0}" |
| 325 | + |
| 326 | + steps: |
| 327 | + - name: Check out repository |
| 328 | + uses: actions/checkout@v7 |
| 329 | + |
| 330 | + - name: Configure linux-gcc-release |
| 331 | + env: |
| 332 | + EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc |
| 333 | + run: cmake --preset linux-gcc-release |
| 334 | + |
| 335 | + - name: Build linux-gcc-release |
| 336 | + env: |
| 337 | + EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc |
| 338 | + run: cmake --build build/gcc-release --target cpfe cpfe-cp |
| 339 | + |
| 340 | + - name: Run benchmarks |
| 341 | + env: |
| 342 | + EDG_BASE: ${{ github.workspace }}/bases/docker/dev-env/gcc |
| 343 | + EDG_BENCH_RUNS_KEPT: '0' |
| 344 | + run: | |
| 345 | + # Use the pull request's own benchmark tooling. |
| 346 | + export PATH="${GITHUB_WORKSPACE}/dev_tools/bin:${PATH}" |
| 347 | + export PYTHONPATH="${GITHUB_WORKSPACE}/dev_tools/pylibs" |
| 348 | + mkdir -p bench-results |
| 349 | + for run in c:bin/cpfe cpp:bin/cpfe-cp; do |
| 350 | + name="${run%%:*}" |
| 351 | + binary="${run#*:}" |
| 352 | + (cd build/gcc-release && source environment.sh && |
| 353 | + edg-bench "${binary}") |
| 354 | + latest="$(ls -1d benchmarks/runs/*/ | sort | tail -n 1)" |
| 355 | + mv "${latest}" "bench-results/${name}" |
| 356 | + done |
| 357 | +
|
| 358 | + - name: Record CI metadata |
| 359 | + env: |
| 360 | + TESTED_SHA: ${{ github.sha }} |
| 361 | + HEAD_SHA: ${{ github.event.pull_request.head.sha }} |
| 362 | + RUN_ID: ${{ github.run_id }} |
| 363 | + RUN_ATTEMPT: ${{ github.run_attempt }} |
| 364 | + run: | |
| 365 | + python3 - > bench-results/ci-meta.json <<'EOF' |
| 366 | + import json, os |
| 367 | + print(json.dumps({ |
| 368 | + 'tested_sha': os.environ['TESTED_SHA'], |
| 369 | + 'head_sha': os.environ['HEAD_SHA'], |
| 370 | + 'run_id': int(os.environ['RUN_ID']), |
| 371 | + 'run_attempt': int(os.environ['RUN_ATTEMPT']), |
| 372 | + }, indent = 2)) |
| 373 | + EOF |
| 374 | +
|
| 375 | + - name: Upload benchmark results |
| 376 | + uses: actions/upload-artifact@v7 |
| 377 | + with: |
| 378 | + name: bench-results |
| 379 | + path: bench-results/ |
| 380 | + if-no-files-found: error |
| 381 | + retention-days: 14 |
0 commit comments