Skip to content

Commit 0a0e64b

Browse files
committed
Gather logs if the build failed
1 parent 53ea0d6 commit 0a0e64b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/workflow.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,21 @@ jobs:
199199
# NOTE keep in sync with tests/RunTests.hs
200200
bazel run @stackage-pinning-test-unpinned//:pin
201201
bazel build @stackage-pinning-test//:hspec
202+
203+
- name: Collect Logs
204+
id: collect_logs
205+
if: failure()
206+
shell: bash
207+
run: |
208+
mkdir -p logs
209+
[[ ${{ matrix.module }} == 'rules_haskell_tests' ]] && cd rules_haskell_tests
210+
export PATH=$HOME/bazel:$PATH
211+
base=$( bazel info output_base )
212+
find "$base" -mindepth 1 -maxdepth 1 -name "java*.log.*" -print0 | xargs -0rI % cp % logs/
213+
214+
- name: Upload Logs
215+
if: steps.collect_logs.conclusion == 'success'
216+
uses: actions/upload-artifact@v3
217+
with:
218+
name: Logs ${{ matrix.os }} ${{ matrix.module }} ${{ matrix.bzlmod }}
219+
path: logs

0 commit comments

Comments
 (0)