Skip to content

Commit

Permalink
Gather logs if the build failed
Browse files Browse the repository at this point in the history
  • Loading branch information
avdv committed Aug 16, 2023
1 parent d61ff28 commit 13312bf
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,25 @@ jobs:
# NOTE keep in sync with tests/RunTests.hs
bazel run @stackage-pinning-test-unpinned//:pin
bazel build @stackage-pinning-test//:hspec
- name: Collect Logs
id: collect_logs
if: failure()
shell: bash
run: |
mkdir -p logs
if [[ ${{ matrix.module }} == 'rules_haskell_tests' ]]; then
dir=rules_haskell_tests
else
dir=.
fi
export PATH=$HOME/bazel:$PATH
base=$( cd "$dir" ; bazel info output_base )
find "$base" -mindepth 1 -maxdepth 1 -name "java*.log.*" -print0 | xargs -0rI % cp % logs/
- name: Upload Logs
if: ${{ failure() && steps.collect_logs.conclusion == 'success' }}
uses: actions/upload-artifact@v3
with:
name: Logs ${{ matrix.os }} ${{ matrix.module }} ${{ matrix.bzlmod }}
path: logs

0 comments on commit 13312bf

Please sign in to comment.