Skip to content

Commit 8cedeeb

Browse files
committed
add core file download for ci test
Signed-off-by: LHT129 <[email protected]>
1 parent f1a22e8 commit 8cedeeb

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/asan_build_and_test.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ jobs:
1818
group: asan_build_x86-${{ github.event.pull_request.number }}
1919
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
2020
steps:
21+
- name: Prepare CoreDump Env
22+
run: |
23+
mkdir -p /tmp/core_file/
24+
cd /tmp/core_file
25+
ulimit -c unlimited
26+
cat /proc/sys/kernel/core_pattern
27+
bash -c "kill -s SIGSEGV $$"
28+
- name: Find Core File
29+
if: always()
30+
run: |
31+
cd /tmp/core_file
32+
corefile_path=`find . -name "core.*"`
33+
echo $corefile_path
34+
mv corefile_path /tmp/core_file/
35+
mkdir -p /var/lib/systemd/coredump/
36+
find /var/lib/systemd/coredump/ -name "core.*"
2137
- name: Free Disk Space
2238
run: rm -rf /useless/hostedtoolcache
2339
- uses: actions/checkout@v4
@@ -90,6 +106,11 @@ jobs:
90106
with:
91107
name: test_x86-${{ github.run_id }}
92108
path: ./build/
109+
- name: Prepare CoreDump Env
110+
run: |
111+
mkdir -p /tmp/core_file/
112+
ulimit -c unlimited
113+
cat /proc/sys/kernel/core_pattern
93114
- name: Do Asan Test In ${{ matrix.test_type }}
94115
run: |
95116
echo leak:libomp.so > omp.supp
@@ -104,6 +125,22 @@ jobs:
104125
compression-level: 1
105126
retention-days: 1
106127
overwrite: 'true'
128+
- name: Find Core File
129+
if: always()
130+
run: |
131+
corefile_path=`find . -name "core.*"`
132+
echo $corefile_path
133+
mv corefile_path /tmp/core_file/
134+
mkdir -p /var/lib/systemd/coredump/
135+
find /var/lib/systemd/coredump/ -name "core.*"
136+
- name: Upload Core File
137+
uses: actions/upload-artifact@v4
138+
with:
139+
path: /tmp/core_file/core*, ./build/test/${{ matrix.test_type }}
140+
name: corefile-x86-${{ matrix.test_type }}-${{ github.run_id }}
141+
compression-level: 1
142+
retention-days: 1
143+
overwrite: 'true'
107144

108145
test_asan_aarch64:
109146
name: Test Aarch64

0 commit comments

Comments
 (0)