Skip to content

Commit ee8c33a

Browse files
committed
chore(CI): only set core names if cores will be dumped
1 parent 398baa8 commit ee8c33a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

.github/workflows/test-and-publish.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,16 @@ jobs:
179179
name: docs-${{ github.run_id }}-${{ github.sha }}
180180
path: ./build/docs/html/
181181
- name: Set cores to get stored in /cores
182+
if: ${{ matrix.os != 'windows-2019' && github.event_name == 'workflow_dispatch' && inputs.dump_cores }}
183+
# TODO (Caleb Aikens) figure out how to get Windows core dumps
182184
run: |
183-
if [[ "$OSTYPE" == "linux-gnu"* || "$OSTYPE" == "darwin"* ]]; then
184-
# TODO (Caleb Aikens) figure out how to get Windows core dumps
185-
sudo mkdir -p /cores
186-
sudo chmod 777 /cores
187-
# Core filenames will be of the form osname.pythonversion.executable.pid.timestamp:
188-
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
189-
sudo bash -c 'echo "/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%t" > /proc/sys/kernel/core_pattern'
190-
else
191-
sudo sysctl kern.corefile="/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%y"
192-
fi
185+
sudo mkdir -p /cores
186+
sudo chmod 777 /cores
187+
# Core filenames will be of the form osname.pythonversion.executable.pid.timestamp:
188+
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
189+
sudo bash -c 'echo "/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%t" > /proc/sys/kernel/core_pattern'
190+
else
191+
sudo sysctl kern.corefile="/cores/${OSTYPE}.$(poetry run python --version).%e.%p.%y"
193192
fi
194193
- name: Run Python tests (pytest)
195194
run: |

0 commit comments

Comments
 (0)