actions: add run-with-log composite action#136
Open
ppetrovicTT wants to merge 3 commits into
Open
Conversation
Wraps a run step to tee output to a .log and append a completion marker, so a GitHub timeout-minutes kill (marker absent) is distinguishable from a crash. Replaces the tee/PIPESTATUS block copied across test workflows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e4666a0 to
5354aeb
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5354aeb to
9bed8b2
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new composite GitHub Action (run-with-log) that runs a multi-line bash script like a normal run: step while teeing combined output to a log file and appending a completion marker line. It also adds a dispatch-only workflow to smoke test success/failure/timeout behavior and documents the action.
Changes:
- Add
./.github/actions/run-with-logcomposite action to tee output into a.logand append[==log-finish-line==] exit_code=N. - Add
test-run-with-logworkflow to validate marker behavior for success, failure, andtimeout-minuteskills. - Add README documentation for usage, inputs, and propagation limitations.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/test-run-with-log.yaml |
Adds a dispatch-only smoke test workflow validating marker presence/absence and ai_summary classification. |
.github/actions/run-with-log/README.md |
Documents the new run-with-log composite action, its marker contract, and usage/limitations. |
.github/actions/run-with-log/action.yml |
Implements the composite action wrapper that writes the script to a temp file, tees output, and appends the completion marker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+42
to
+47
| bash --noprofile --norc -eo pipefail "$script" 2>&1 | tee "$RUN_WITH_LOG_FILE" | ||
| rc=${PIPESTATUS[0]} | ||
| rm -f "$script" | ||
|
|
||
| printf '[==log-finish-line==] exit_code=%s\n' "$rc" >> "$RUN_WITH_LOG_FILE" | ||
| exit $rc |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #135.
The writer half of the timeout-detection contract (parser added in #134). A composite action that runs a bash script like a normal
run:step, tees combined output to a.log, and appends[==log-finish-line==] exit_code=Nas the final line. Marker absent ⇒ the shell was killed before finishing (GitHubtimeout-minutes) ⇒ai_summaryreports TIMEOUT instead of a false SUCCESS.Replaces the hand-copied
tee/PIPESTATUSblock across ~10 test workflows.Design notes
run(not a single command): written to a temp file and executedbash --noprofile --norc -eo pipefail, identical to how arun:step executes — full multi-line/heredoc/set -efidelity.working-directorydefault/work: composite steps can't inherit the job'sdefaults.run.working-directory(same reason compositerunsteps must declareshell:), so it's an input. Defaulted to the TT container workdir; override per call (multihost passes/home/user/tt-metal).log-file: explicit path; parent dirs created (mkdir -p).set +ein the wrapper: a failing script still gets the marker, so a normal failure stays a failure (marker present, nonzero exit) and never masquerades as a timeout.$GITHUB_OUTPUTwritten inside the script doesn't propagate (composite actions only expose declared outputs); none of the target steps set outputs.Verified locally: multi-line script + heredoc,
set -emid-script abort, nestedlog-filedir creation, exit-code forwarding, marker on success/failure, marker absent on hard kill.Next: convert the ~10 tt-metal test impls to use it.
🤖 Generated with Claude Code