Skip to content

Commit

Permalink
Refine workflow artifacts
Browse files Browse the repository at this point in the history
This commit adds nominal logging for `test_all` and `style_all` in
separate directories so they can easily be differentiated.
  • Loading branch information
dinkelk committed Sep 14, 2024
1 parent 3a00cef commit 158e1cd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_user_guide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: user_guide
path: doc/user_guide/build/pdf/user_guide.pdf
path: ${{ github.workspace }}/doc/user_guide/build/pdf/user_guide.pdf
if-no-files-found: error
- name: Build the architecture description document
run: bash env/github_run.sh "redo doc/architecture_description_document/build/pdf/architecture_description_document.pdf"
- name: Archive user guide PDF
uses: actions/upload-artifact@v4
with:
name: architecture_description_document
path: doc/architecture_description_document/build/pdf/architecture_description_document.pdf
path: ${{ github.workspace }}/doc/architecture_description_document/build/pdf/architecture_description_document.pdf
if-no-files-found: error
- run: echo "Finished with status - ${{ job.status }}."
4 changes: 2 additions & 2 deletions .github/workflows/style_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
if: always() # Make sure this runs even if `redo style_all` fails
uses: actions/upload-artifact@v4
with:
name: failed_style_logs
path: build/failed_style_logs
name: style_logs
path: ${{ github.workspace }}/build
if-no-files-found: ignore
- run: echo "Finished with status - ${{ job.status }}."
if: always()
4 changes: 2 additions & 2 deletions .github/workflows/test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
if: always() # Make sure this runs even if `redo test_all` fails
uses: actions/upload-artifact@v4
with:
name: failed_test_logs
path: ${{ github.workspace }}/build/failed_test_logs
name: test_logs
path: ${{ github.workspace }}/build
if-no-files-found: ignore
- run: echo "Finished with status - ${{ job.status }}."
if: always()
5 changes: 4 additions & 1 deletion redo/rules/build_style_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ def build(self, redo_1, redo_2, redo_3):

# Make a build directory at the top level:
failed_style_log_dir = os.path.join(directory, "build" + os.sep + "failed_style_logs")
log_dir = os.path.join(directory, "build" + os.sep + "style_logs")
filesystem.safe_makedir(failed_style_log_dir)
filesystem.safe_makedir(log_dir)

# Run tests:
exit_code = 0
Expand All @@ -96,7 +98,8 @@ def build(self, redo_1, redo_2, redo_3):
sys.stderr.flush()
database.setup.reset()
try:
redo.redo([os.path.join(test, "style"), "2>/dev/null", "1>/dev/null"])
style_run_log = os.path.join(log_dir, rel_test.replace(os.sep, "_") + ".log")
redo.redo([os.path.join(test, "style"), "1>&2", "2>" + style_run_log])

# See if there is anything in the log file:
style_log = os.path.join(
Expand Down
2 changes: 1 addition & 1 deletion redo/rules/build_test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def build(self, redo_1, redo_2, redo_3):

# Make a build directory at the top level:
failed_test_log_dir = os.path.join(directory, "build" + os.sep + "failed_test_logs")
log_dir = os.path.join(directory, "build" + os.sep + "log")
log_dir = os.path.join(directory, "build" + os.sep + "test_logs")
filesystem.safe_makedir(failed_test_log_dir)
filesystem.safe_makedir(log_dir)

Expand Down

0 comments on commit 158e1cd

Please sign in to comment.