Skip to content

Commit 9990148

Browse files
ATfE - Save build and test logs as artifacts (#540)
- GitHub's backend struggles to serve large log files. Hence, developers can't download them and this way investigate failures - Saving the logs will allow users to download them in a zip archive, providing a more reliable mechanism - Set pipefail and LASTEXITCODE to propagate failures when piping
1 parent bbab2f1 commit 9990148

File tree

1 file changed

+36
-6
lines changed

1 file changed

+36
-6
lines changed

.github/workflows/atfe_nightly_build_and_test.yml

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,42 @@ jobs:
8787
- name: Apply llvm-project-perf patches
8888
run: python3 arm-software/embedded/cmake/patch_repo.py --method apply arm-software/embedded/patches/llvm-project-perf
8989

90-
- name: Build ${{ matrix.build_script }}
91-
run: ./arm-software/embedded/scripts/${{ matrix.build_script }}
92-
93-
- name: Test ${{ matrix.test_script }}
94-
if: matrix.test_script != ''
95-
run: ./arm-software/embedded/scripts/${{ matrix.test_script }}
90+
- name: Build (Unix)
91+
if: runner.os != 'Windows'
92+
run: |
93+
set -o pipefail # ensure failure is propagated even when piping to tee
94+
./arm-software/embedded/scripts/${{ matrix.build_script }} 2>&1 | tee build.log
95+
96+
- name: Build (Windows)
97+
if: runner.os == 'Windows'
98+
shell: pwsh
99+
run: |
100+
$ErrorActionPreference = 'Stop'
101+
.\arm-software\embedded\scripts\${{ matrix.build_script }} *>&1 | Tee-Object -FilePath build.log
102+
if ($LASTEXITCODE) { exit $LASTEXITCODE } # Propagate failure
103+
104+
- name: Test (Unix)
105+
if: runner.os != 'Windows' && matrix.test_script != ''
106+
run: |
107+
set -o pipefail # ensure failure is propagated even when piping to tee
108+
./arm-software/embedded/scripts/${{ matrix.test_script }} 2>&1 | tee test.log
109+
110+
- name: Test (Windows)
111+
if: runner.os == 'Windows' && matrix.test_script != ''
112+
shell: pwsh
113+
run: |
114+
$ErrorActionPreference = 'Stop'
115+
.\arm-software\embedded\scripts\${{ matrix.test_script }} *>&1 | Tee-Object -FilePath test.log
116+
if ($LASTEXITCODE) { exit $LASTEXITCODE } # Propagate failure
117+
118+
- name: Upload logs as artifact
119+
uses: actions/upload-artifact@v4
120+
if: always()
121+
with:
122+
name: logs-${{ matrix.build_script }}-${{ matrix.target_os }}
123+
path: |
124+
build.log
125+
test.log
96126
97127
- name: Upload test results
98128
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)