diff --git a/.github/actions/test-capture-variant/action.yml b/.github/actions/test-capture-variant/action.yml index dc315574..7291af31 100644 --- a/.github/actions/test-capture-variant/action.yml +++ b/.github/actions/test-capture-variant/action.yml @@ -85,7 +85,7 @@ runs: build-type: ${{ inputs.preset == 'debug' && 'Debug' || 'Release' }} macos-arch: ${{ inputs.macos-arch }} - name: Save verified variant Cargo cache - if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && steps.cache.outputs.cache-hit != 'true' + if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) && steps.cache.outputs.cache-hit != 'true' uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: ${{ steps.variant.outputs.cargo-dir }} diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 68a2485a..3afade7c 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -176,6 +176,7 @@ jobs: build-dir: ${{ env.BUILD_DIR }} - name: Test installed standard SDK + if: github.ref == 'refs/heads/main' uses: ./.github/actions/test-sdk-bundle with: bundle-dir: sdk-out/livekit-sdk-${{ matrix.name }} @@ -211,14 +212,6 @@ jobs: with: build-dir: ${{ env.BUILD_DIR }} - - name: Test installed capture SDK - if: matrix.name != 'macos-x64' - uses: ./.github/actions/test-sdk-bundle - with: - bundle-dir: sdk-out/livekit-sdk-${{ matrix.name }}-capture - capture: 'all' - macos-arch: ${{ matrix.macos_arch || '' }} - - name: Upload capture SDK bundle if: matrix.name != 'macos-x64' uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02f465cc..b2da2bf6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,6 +78,7 @@ jobs: - vcpkg.json - .github/workflows/ci.yml - .github/workflows/tests.yml + - .github/workflows/memory-comment.yml - .github/workflows/nightly.yml - .github/actions/setup-sdk-deps/** - .github/actions/setup-capture/** diff --git a/.github/workflows/make-release.yml b/.github/workflows/make-release.yml index e7449902..25f93698 100644 --- a/.github/workflows/make-release.yml +++ b/.github/workflows/make-release.yml @@ -33,16 +33,19 @@ jobs: name: ubuntu-22.04-arm64 - os: ubuntu-24.04 name: ubuntu-24.04-x64 + selective_capture: true - os: ubuntu-24.04-arm name: ubuntu-24.04-arm64 - os: macos-26-xlarge name: macos-arm64 + selective_capture: true - os: macos-26-large name: macos-x64 macos_arch: x86_64 # Pinned to Windows 2022 for current VS 17 implementation - os: windows-2022 name: windows-x64 + selective_capture: true name: Build (${{ matrix.name }}) runs-on: ${{ matrix.os }} @@ -106,6 +109,24 @@ jobs: - name: Set up base SDK dependencies uses: ./.github/actions/setup-sdk-deps + with: + linux-extra-packages: ${{ matrix.selective_capture && 'mesa-vulkan-drivers libvulkan1' || '' }} + + - name: Configure software Vulkan for capture source checks + if: runner.os == 'Linux' && matrix.selective_capture + shell: bash + run: | + set -euo pipefail + icds=(/usr/share/vulkan/icd.d/lvp_icd*.json) + test -f "${icds[0]}" + runtime_dir="$RUNNER_TEMP/capture-runtime" + mkdir -p "$runtime_dir" + chmod 700 "$runtime_dir" + { + echo "VK_ICD_FILENAMES=${icds[0]}" + echo "WGPU_BACKEND=vulkan" + echo "XDG_RUNTIME_DIR=$runtime_dir" + } >> "$GITHUB_ENV" # ---------- Rust toolchain ---------- - name: Install Rust (stable) @@ -195,8 +216,16 @@ jobs: macos-arch: ${{ matrix.macos_arch || '' }} version: ${{ steps.version.outputs.version }} + - name: Test selective capture bundles + if: matrix.selective_capture + uses: ./.github/actions/test-capture-variants + with: + preset: release + combinations: 'true' + verify-pixel-sources: ${{ runner.os != 'Windows' }} + - name: Set up capture dependencies - if: matrix.name != 'macos-x64' + if: matrix.name != 'macos-x64' && !matrix.selective_capture uses: ./.github/actions/setup-capture - name: Rebuild with capture @@ -221,6 +250,7 @@ jobs: with: bundle-dir: sdk-out/livekit-sdk-${{ matrix.name }}-capture-${{ steps.version.outputs.version }} capture: 'all' + verify-pixel-sources: ${{ matrix.selective_capture && runner.os != 'Windows' }} macos-arch: ${{ matrix.macos_arch || '' }} version: ${{ steps.version.outputs.version }} diff --git a/.github/workflows/memory-comment.yml b/.github/workflows/memory-comment.yml new file mode 100644 index 00000000..4aff0e09 --- /dev/null +++ b/.github/workflows/memory-comment.yml @@ -0,0 +1,100 @@ +# Copyright 2026 LiveKit, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Memory results comment + +on: + workflow_run: + workflows: [CI] + types: [completed] + +# Keep write access out of the build jobs, including builds of fork PRs. +# This workflow never checks out or executes code from the triggering run. +permissions: + actions: read + contents: read + pull-requests: write + +concurrency: + group: memory-results-${{ github.event.workflow_run.head_repository.full_name }}-${{ github.event.workflow_run.head_branch }} + cancel-in-progress: false + +jobs: + comment: + if: github.event.workflow_run.event == 'pull_request' + runs-on: ubuntu-24.04 + steps: + - name: Find memory report + id: report + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const run = context.payload.workflow_run; + const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, { + ...context.repo, run_id: run.id + }); + const artifact = artifacts.find(item => + item.name === `memory-tester-report-${run.run_attempt}` && !item.expired); + if (artifact) core.setOutput('artifact-id', artifact.id); + + - name: Download memory report + if: steps.report.outputs.artifact-id != '' + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + artifact-ids: ${{ steps.report.outputs.artifact-id }} + merge-multiple: true + path: ${{ runner.temp }}/memory-results + github-token: ${{ github.token }} + run-id: ${{ github.event.workflow_run.id }} + + - name: Update PR comment + if: steps.report.outputs.artifact-id != '' + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const fs = require('node:fs'); + const run = context.payload.workflow_run; + // Resolve the PR through GitHub, never through downloaded metadata. + // The workflow_run pull_requests array can be empty for fork PRs. + const pulls = await github.paginate(github.rest.repos.listPullRequestsAssociatedWithCommit, { + ...context.repo, commit_sha: run.head_sha + }); + const marker = ''; + const report = fs.readFileSync(`${process.env.RUNNER_TEMP}/memory-results/memory-tester-report.md`, 'utf8'); + if (report.length > 32000) throw new Error('Memory report is too large'); + const needsAttention = /:x: (FAIL|ERROR)|:warning: ADVISORY/.test(report); + for (const pull of pulls) { + const { data: current } = await github.rest.pulls.get({ + ...context.repo, pull_number: pull.number + }); + if (current.state !== 'open' || current.head.sha !== run.head_sha || + current.base.repo.full_name !== `${context.repo.owner}/${context.repo.repo}`) continue; + const comments = await github.paginate(github.rest.issues.listComments, { + ...context.repo, issue_number: pull.number + }); + const existing = comments.find(comment => + comment.user.login === 'github-actions[bot]' && comment.body?.startsWith(marker)); + // A delayed completion or rerun must not replace a newer result. + const previous = existing?.body.match(//); + if (previous && (Number(previous[1]) > run.id || + (Number(previous[1]) === run.id && Number(previous[2]) > run.run_attempt))) continue; + const body = `${marker}\n\n` + + `${needsAttention ? '⚠️ Memory checks need attention.' : '✅ Memory checks passed.'}\n\n` + + `[CI run](${run.html_url}/attempts/${run.run_attempt}) · Commit ${run.head_sha}\n\n${report}`; + if (existing) { + await github.rest.issues.updateComment({ ...context.repo, comment_id: existing.id, body }); + } else { + await github.rest.issues.createComment({ ...context.repo, issue_number: pull.number, body }); + } + } diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 078ed61c..1b1f2969 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,8 +4,8 @@ name: Tests on: workflow_call: inputs: - extended_capture_sources: - description: Test pair combinations and selective bundles on macOS/Windows as well as Linux. + run_capture_bundle_tests: + description: Check selective and all-sources capture bundles outside PR runs. required: false type: boolean default: false @@ -61,11 +61,6 @@ on: default: true workflow_dispatch: inputs: - extended_capture_sources: - description: Test pair combinations and selective bundles on macOS/Windows as well as Linux. - required: false - type: boolean - default: false build_type: description: Debug or release test build. required: false @@ -162,7 +157,7 @@ jobs: e2e-testing: true - os: macos-26-xlarge name: macos-arm64 - extended_capture: true + selective_capture: true e2e-testing: true - os: macos-26-large name: macos-x64 @@ -171,7 +166,7 @@ jobs: # Pinned to Windows 2022 for current VS 17 implementation - os: windows-2022 name: windows-x64 - extended_capture: true + selective_capture: true e2e-testing: true name: Test (${{ matrix.name }}) @@ -224,7 +219,7 @@ jobs: linux-extra-packages: libunwind-dev libjpeg-dev gdb jq ${{ matrix.selective_capture && 'mesa-vulkan-drivers libvulkan1' || '' }} - name: Configure software Vulkan for capture source checks - if: matrix.selective_capture + if: runner.os == 'Linux' && matrix.selective_capture shell: bash run: | set -euo pipefail @@ -320,6 +315,7 @@ jobs: macos-arch: ${{ matrix.macos_arch || '' }} - name: Test installed standard SDK + if: github.ref == 'refs/heads/main' uses: ./.github/actions/test-sdk-bundle with: bundle-dir: sdk-out/test-sdk-standard @@ -328,16 +324,16 @@ jobs: build-type: ${{ inputs.build_type == 'debug' && 'Debug' || 'Release' }} - name: Test selective capture bundles - if: matrix.name != 'macos-x64' && (matrix.selective_capture || (inputs.extended_capture_sources && matrix.extended_capture)) + id: capture_bundles + if: inputs.run_capture_bundle_tests && github.event_name != 'pull_request' && matrix.selective_capture uses: ./.github/actions/test-capture-variants with: preset: ${{ inputs.build_type }} - combinations: ${{ inputs.extended_capture_sources }} - verify-pixel-sources: ${{ matrix.selective_capture || runner.os == 'macOS' }} - macos-arch: ${{ matrix.macos_arch || '' }} + combinations: 'true' + verify-pixel-sources: ${{ runner.os != 'Windows' }} - name: Set up capture dependencies - if: ${{ matrix.name != 'macos-x64' && !(matrix.selective_capture || (inputs.extended_capture_sources && matrix.extended_capture)) }} + if: matrix.name != 'macos-x64' && steps.capture_bundles.outcome == 'skipped' uses: ./.github/actions/setup-capture - name: Build SDK with tests @@ -348,13 +344,13 @@ jobs: bundle-dir: sdk-out/test-sdk-tests macos-arch: ${{ matrix.macos_arch || '' }} - - name: Test installed SDK used by tests + - name: Test installed capture SDK + if: inputs.run_capture_bundle_tests && github.event_name != 'pull_request' && matrix.name != 'macos-x64' uses: ./.github/actions/test-sdk-bundle with: bundle-dir: sdk-out/test-sdk-tests - capture: ${{ matrix.name == 'macos-x64' && 'none' || 'all' }} - verify-pixel-sources: ${{ matrix.selective_capture || (inputs.extended_capture_sources && runner.os == 'macOS' && matrix.extended_capture) }} - macos-arch: ${{ matrix.macos_arch || '' }} + capture: 'all' + verify-pixel-sources: ${{ matrix.selective_capture && runner.os != 'Windows' }} build-type: ${{ inputs.build_type == 'debug' && 'Debug' || 'Release' }} # ---------- Run unit tests ---------- @@ -457,11 +453,13 @@ jobs: --gtest_output=xml:${{ env.BUILD_DIR }}/integration-test-results.xml - name: Run memory tester + id: memory if: matrix.name == 'ubuntu-24.04-x64' && inputs.build_type == 'release' timeout-minutes: 10 shell: bash run: | set -euo pipefail + export MEMORY_TESTER_REPORT="$RUNNER_TEMP/memory-tester-report.md" source scripts/set-test-tokens.sh scripts/memory-tester.sh \ --build-dir "${{ env.BUILD_DIR }}" \ @@ -469,10 +467,30 @@ jobs: --iterations 100 \ --warmup 20 \ --max-rss-growth-mib 24 \ - --max-thread-growth 2 \ + --max-thread-growth 10 \ --advisory-max-rss-growth-mib 8 \ --advisory-max-thread-growth 0 + - name: Summarize memory results + if: always() && steps.memory.outcome != 'skipped' && steps.memory.outcome != '' + shell: bash + env: + MEMORY_OUTCOME: ${{ steps.memory.outcome }} + run: | + report="$RUNNER_TEMP/memory-tester-report.md" + if [[ "$MEMORY_OUTCOME" != 'success' ]]; then + echo ':x: FAIL — memory tester did not complete successfully. See the run logs.' >> "$report" + fi + cat "$report" >> "$GITHUB_STEP_SUMMARY" + + - name: Upload memory results + if: always() && steps.memory.outcome != 'skipped' && steps.memory.outcome != '' + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: memory-tester-report-${{ github.run_attempt }} + path: ${{ runner.temp }}/memory-tester-report.md + retention-days: ${{ inputs.artifact_retention_days }} + - name: Run stress tests if: matrix.e2e-testing && inputs.run_stress_tests timeout-minutes: ${{ inputs.stress_timeout_minutes }} diff --git a/AGENTS.md b/AGENTS.md index d9daf703..444821e3 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -420,12 +420,17 @@ all filtered stages; normal pull requests and pushes use the path filters. - `.github/workflows/ci.yml` — Top-level PR/push/manual aggregator and path filter owner. - `.github/workflows/builds.yml` — Reusable SDK and example-collection build - matrix. Each platform job builds, validates, and uploads the standard SDK, - then enables capture in the same CMake tree and produces a separate capture - bundle. Save the Cargo target cache only after both builds complete. + matrix. Each platform job builds and uploads the standard SDK, validating its + installed bundle only on `main`, then enables capture in the same CMake tree + and produces a separate capture bundle. Save the Cargo target cache only + after both builds complete. - `.github/workflows/tests.yml` — Reusable unit/integration test matrix. - Each platform job first validates an installed standard SDK, then rebuilds - with capture enabled and runs the complete test suite once. + Each platform job builds a standard SDK (validating its installed bundle only + on `main`), then rebuilds with capture enabled and runs the complete test + suite once. + Capture bundle packaging checks run in nightly tests and `make-release.yml`, including + singleton/pair variants on Linux x64, macOS arm64, and Windows x64 and the + final all-sources release bundles on every capture-supported platform. The build, test, and release jobs use the shared actions under `.github/actions/`; keep platform-specific build and bundle checks there. - `.github/workflows/cpp-tools.yml` — Reusable SDK-specific `clang-format` and diff --git a/docs/testing.md b/docs/testing.md index 09525611..dde85145 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -147,33 +147,30 @@ capture-enabled CI release jobs, the expectation is explicitly `ON`; a disabled bundle cannot pass by rejecting source creation. On Windows, add the installed SDK's `bin` directory and GStreamer's `bin` directory to `PATH` before running CTest. -### Selective capture in CI +### Capture packaging in nightly and release runs + +Capture bundle packaging checks run in nightly tests and the release workflow, +including manual nightly runs and releases. Regular CI retains capture builds +and runtime tests, but skips capture packaging checks. Standard SDK packaging checks +run on `main` and in releases; PRs and manual runs on other branches skip them. Intel macOS CI runs the standard SDK tests only; capture builds and checks are not supported on that platform. -The Ubuntu 24.04 x64 test job checks `none`, each singleton source, and `all`. -Singleton builds reuse the C++ build tree and do not compile the unit/integration -suites. Pattern and clock builds run before GStreamer installation. This runner -uses Mesa software Vulkan, and pixel-source creation must succeed. The full test -suite runs once after rebuilding with all sources. - -The reusable `test-capture-variants` action uses `build-sdk` and -`test-sdk-bundle`. The latter accepts `expected-sources` and -`verify-pixel-sources`, so build, test, and release workflows share one installed -consumer test. Nightly runs enable `extended_capture_sources`, adding the three -two-source combinations on Linux and selective bundles on macOS arm64 and -Windows x64. Windows validates exact metadata and source availability, allowing -an explicit missing-adapter error for enabled pixel sources. Successful pixel -creation is required on Linux and macOS. Manual test-workflow runs can enable -the same coverage. +Nightly runs and releases check each singleton source and all three two-source combinations on +Ubuntu 24.04 x64, macOS arm64, and Windows x64 using `test-capture-variants`. +These builds reuse the C++ build tree without compiling the unit/integration +suites. Pattern and clock builds run before GStreamer installation. Linux uses +Mesa software Vulkan. Pixel-source creation must succeed on Linux and macOS; +Windows allows an explicit missing-adapter error for enabled pixel sources. +All-sources bundles are checked on every capture-supported platform. Releases +also verify the final bundle's version metadata before publication. Cargo caches include the build configuration, build type, and source selection. -Each variant reports elapsed time and cache hits in the job summary. Each selective variant has its own cache, saved after its installed-bundle check -passes on trusted main runs. The variant's temporary Cargo directory is then -removed to bound disk usage. Standard/all outputs use the existing shared cache, -saved after the full suite passes. Rust variants still compile separately on +passes on trusted main or version-tag runs. The variant's temporary Cargo +directory is then removed to bound disk usage. Standard/all outputs use the existing shared cache, +saved after successful builds. Rust variants still compile separately on cold runs even though C++ dependencies are reused. ## Test coverage @@ -219,12 +216,16 @@ Each scenario reports process RSS and thread count at cycle 0, after warmup cycle 20, and after final cycle 100. Checkpoint sampling waits for the thread count to remain stable for 500 ms so short-lived teardown work does not cause a false failure. The gate applies to warmup-to-final growth. CI fails above its -blocking limits of 24 MiB RSS or two threads, which protects against large +blocking limits of 24 MiB RSS or 10 threads, which protects against large customer-impacting regressions while allowing for allocator and dependency variation. It also emits a non-blocking advisory above 8 MiB RSS or zero threads. If threads grow, the tester reports when the final sustained growth began and groups the warmup and final threads by their Linux thread names. +Each PR run with memory results creates or updates a single comment with the +scenario table and a link to the CI run, including passing results. PR commenting is +handled by a separate workflow, which becomes active once it is on `main`. + The binary can be run directly, or via a helper script at `scripts/memory-tester.sh`, which invokes the binary but also has GitHub actions support for a results summary table. The helper defaults `MALLOC_ARENA_MAX` to `1` when launching each tester process. @@ -239,11 +240,11 @@ tokens before running any scenario: source scripts/set-test-tokens.sh scripts/memory-tester.sh --scenario audio-track \ --iterations 100 --warmup 20 \ - --max-rss-growth-mib 24 --max-thread-growth 2 \ + --max-rss-growth-mib 24 --max-thread-growth 10 \ --advisory-max-rss-growth-mib 8 --advisory-max-thread-growth 0 scripts/memory-tester.sh --scenario video-track \ --iterations 100 --warmup 20 \ - --max-rss-growth-mib 24 --max-thread-growth 2 \ + --max-rss-growth-mib 24 --max-thread-growth 10 \ --advisory-max-rss-growth-mib 8 --advisory-max-thread-growth 0 ``` diff --git a/scripts/memory-tester.sh b/scripts/memory-tester.sh index b778326f..c4e40703 100755 --- a/scripts/memory-tester.sh +++ b/scripts/memory-tester.sh @@ -50,6 +50,7 @@ Environment: MEMORY_TESTER_MAX_THREAD_GROWTH, MEMORY_TESTER_ADVISORY_MAX_RSS_GROWTH_MIB, MEMORY_TESTER_ADVISORY_MAX_THREAD_GROWTH, MALLOC_ARENA_MAX. + MEMORY_TESTER_REPORT overrides the GITHUB_STEP_SUMMARY report destination. All scenarios require LIVEKIT_URL and LIVEKIT_TOKEN_A. EOF } @@ -63,6 +64,7 @@ max_rss_growth_mib="${MEMORY_TESTER_MAX_RSS_GROWTH_MIB:-8}" max_thread_growth="${MEMORY_TESTER_MAX_THREAD_GROWTH:-0}" advisory_max_rss_growth_mib="${MEMORY_TESTER_ADVISORY_MAX_RSS_GROWTH_MIB:-}" advisory_max_thread_growth="${MEMORY_TESTER_ADVISORY_MAX_THREAD_GROWTH:-}" +summary_file="${MEMORY_TESTER_REPORT:-${GITHUB_STEP_SUMMARY:-}}" while (($#)); do case "$1" in @@ -131,7 +133,7 @@ for current_scenario in "${scenarios[@]}"; do fi done -if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then +if [[ -n "${summary_file}" ]]; then { echo "## Memory tester results" echo @@ -142,7 +144,7 @@ if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then echo echo "| Scenario | RSS 0→${warmup} | RSS ${warmup}→${iterations} | Threads 0→${warmup} | Threads ${warmup}→${iterations} | Status |" echo "|---|---:|---:|---:|---:|---|" - } >> "${GITHUB_STEP_SUMMARY}" + } >> "${summary_file}" fi report_regex='memory tester: scenario=([a-z-]+), RSS 0 ([0-9]+\.[0-9]+) -> warmup ([0-9]+\.[0-9]+) MiB \((-?[0-9]+\.[0-9]+) MiB\) -> final ([0-9]+\.[0-9]+) MiB \((-?[0-9]+\.[0-9]+) MiB\), threads 0 ([0-9]+) -> warmup ([0-9]+) \((-?[0-9]+)\) -> final ([0-9]+) \((-?[0-9]+)\), verdict=(PASS|FAIL), advisory=(PASS|FAIL)' @@ -186,7 +188,7 @@ for current_scenario in "${scenarios[@]}"; do fi fi - if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then + if [[ -n "${summary_file}" ]]; then if [[ "${BASH_REMATCH[12]}" == "FAIL" ]]; then verdict=":x: FAIL" elif [[ "${advisory_exceeded}" == "true" ]]; then @@ -199,12 +201,12 @@ for current_scenario in "${scenarios[@]}"; do thread_warmup_growth="$(format_growth "${BASH_REMATCH[9]}")" thread_final_growth="$(format_growth "${BASH_REMATCH[11]}")" echo "| ${BASH_REMATCH[1]} | ${rss_warmup_growth} MiB | ${rss_final_growth} MiB | ${thread_warmup_growth} | ${thread_final_growth} | ${verdict} |" \ - >> "${GITHUB_STEP_SUMMARY}" + >> "${summary_file}" fi else echo "ERROR: ${current_scenario} did not produce a memory report." >&2 - if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then - echo "| ${current_scenario} | — | — | — | — | :x: ERROR |" >> "${GITHUB_STEP_SUMMARY}" + if [[ -n "${summary_file}" ]]; then + echo "| ${current_scenario} | — | — | — | — | :x: ERROR |" >> "${summary_file}" fi status=1 fi