Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update the core-dump pattern with a path suffix #6142

Merged
merged 4 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/actions/core-dump/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ description: 'List down and upload core dumps as artifacts'
runs:
using: "composite"
steps:
- run: ls -l
- name: List down core dump files
run: |
ls -lah /cores/
sudo chmod -R +rwx /cores/*
shell: sh

- name: Backup core dump
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: core-dump
path: core.*
path: /cores/*
48 changes: 16 additions & 32 deletions .github/actions/setup-debug-node/action.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
name: 'Setup node with debug support'
description: 'Setup the nodejs version with debug support'
inputs:
node-version:
description: 'Version of nodejs'
required: true
default: '20'
debug:
description: Enable the debug version
required: true
default: 'false'

name: "Setup node with debug support"
description: "Setup the nodejs version with debug support"
runs:
using: "composite"
steps:
- uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
check-latest: true
cache: yarn

# For now we only have the Node 20 debug build
- run: sudo apt-get install unzip && curl -L "https://drive.google.com/uc?export=download&id=1hlhbbQi-NJi8_WjULvOdo-K_tfZFzN3Z&confirm=t" > nodejs.zip && unzip nodejs.zip
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: sudo cp -f node $(which node)
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: sudo sh -c "ulimit -c unlimited"
- run: |
sudo apt-get install unzip && curl -L "https://drive.google.com/uc?export=download&id=1hlhbbQi-NJi8_WjULvOdo-K_tfZFzN3Z&confirm=t" > nodejs.zip && unzip nodejs.zip
sudo cp -f node /usr/bin/node-with-debug
sudo chmod +x /usr/bin/node-with-debug
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: sudo sh -c "echo core > /proc/sys/kernel/core_pattern"
shell: sh
if: ${{ inputs.debug == 'true' }}
- run: echo $(node --print "process.version")

# List of naming patterns
# https://man7.org/linux/man-pages/man5/core.5.html
- run: |
sudo mkdir -p /cores
sudo sh -c "echo /cores/core-%e-%s-%u-%g-%p-%t > /proc/sys/kernel/core_pattern"
shell: sh
- run: echo $(node --print "process.features.debug")

- run: |
echo $(/usr/bin/node-with-debug --print "process.version")
echo $(/usr/bin/node-with-debug --print "process.features.debug")
shell: sh

14 changes: 10 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,14 @@ jobs:
node: [20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
check-latest: true
cache: yarn

# Remove when finished debugging core dumps
- uses: './.github/actions/setup-debug-node'
with:
node-version: ${{matrix.node}}
debug: 'true'

- name: Restore build cache
id: cache-primes-restore
Expand All @@ -181,8 +185,10 @@ jobs:

- name: Unit tests
id: unit_tests
run: yarn test:unit
# Rever to "yarn test:unit" when finished debugging core dumps
run: sudo sh -c "ulimit -c unlimited && /usr/bin/node-with-debug $(which yarn) test:unit"

# Remove when finished debugging core dumps
- uses: './.github/actions/core-dump'
if: ${{ failure() && steps.unit_tests.conclusion == 'failure' }}

Expand Down