Skip to content

Commit

Permalink
Upload core files when the Builds job fails on Linux. (project-chip#2…
Browse files Browse the repository at this point in the history
…0125)

* Upload core files when the Builds job fails on Linux.

We've had some crashes recently in the job that would be good to debug.

* Address review comments.

* Go back to uploading the whole objdir.
  • Loading branch information
bzbarsky-apple authored Jun 30, 2022
1 parent 76a08ac commit c8bfba9
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
image: connectedhomeip/chip-build:0.5.79
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

steps:
Expand All @@ -57,6 +57,11 @@ jobs:
attempt_delay: 2000
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Try to ensure the directories for core dumping exist and we
can write them.
run: |
mkdir /tmp/cores || true
sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -99,6 +104,22 @@ jobs:
- name: Run Build Without Error Logging
timeout-minutes: 20
run: scripts/run_in_build_env.sh "ninja -C ./out"
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() }} && ${{ !env.ACT }}
with:
name: crash-core-linux-gcc-debug
path: /tmp/cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
if: ${{ failure() }} && ${{ !env.ACT }}
with:
name: crash-objdir-linux-gcc-debug
path: out/
# objdirs are big; don't hold on to them too long.
retention-days: 5
build_linux:
name: Build on Linux (fake, gcc_release, clang, simulated)
timeout-minutes: 120
Expand All @@ -110,7 +131,7 @@ jobs:
image: connectedhomeip/chip-build:0.5.79
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

steps:
Expand All @@ -137,6 +158,11 @@ jobs:
# languages: "cpp"
- name: Checkout submodules
run: scripts/checkout_submodules.py --shallow --platform linux
- name: Try to ensure the directories for core dumping exist and we
can write them.
run: |
mkdir /tmp/cores || true
sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true
- name: Bootstrap
timeout-minutes: 10
run: scripts/build/gn_bootstrap.sh
Expand Down Expand Up @@ -211,6 +237,22 @@ jobs:
run: |
./scripts/run_in_build_env.sh \
"./scripts/build/build_examples.py --no-log-timestamps --target linux-fake-tests build"
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() }} && ${{ !env.ACT }}
with:
name: crash-core-linux
path: /tmp/cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
if: ${{ failure() }} && ${{ !env.ACT }}
with:
name: crash-objdir-linux
path: out/
# objdirs are big; don't hold on to them too long.
retention-days: 5

# TODO Log Upload https://github.com/project-chip/connectedhomeip/issues/2227
# TODO https://github.com/project-chip/connectedhomeip/issues/1512
Expand Down

0 comments on commit c8bfba9

Please sign in to comment.