diff --git a/.github/actions/core-dump/action.yml b/.github/actions/core-dump/action.yml new file mode 100644 index 000000000000..6735f0f2c355 --- /dev/null +++ b/.github/actions/core-dump/action.yml @@ -0,0 +1,13 @@ +name: 'Take core dump files' +description: 'List down and upload core dumps as artifacts' +runs: + using: "composite" + steps: + - run: ls -l + shell: sh + + - name: Backup core dump + uses: actions/upload-artifact@v2 + with: + name: core-dump + path: core.* diff --git a/.github/actions/setup-debug-node/action.yml b/.github/actions/setup-debug-node/action.yml new file mode 100644 index 000000000000..3e9a12cd208f --- /dev/null +++ b/.github/actions/setup-debug-node/action.yml @@ -0,0 +1,39 @@ +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' + +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" + 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") + shell: sh + - run: echo $(node --print "process.features.debug") + shell: sh + diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d3355d36fb86..1ddb929f271a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -153,12 +153,12 @@ jobs: matrix: node: [20] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: + - uses: actions/checkout@v3 + - uses: './.github/actions/setup-debug-node' + with: node-version: ${{matrix.node}} - check-latest: true - cache: yarn + debug: 'true' + - name: Restore build cache id: cache-primes-restore uses: actions/cache/restore@v3 @@ -180,7 +180,12 @@ jobs: key: spec-test-data-${{ hashFiles('packages/validator/test/spec/params.ts') }} - name: Unit tests + id: unit_tests run: yarn test:unit + + - uses: './.github/actions/core-dump' + if: ${{ failure() && steps.unit_tests.conclusion == 'failure' }} + - name: Upload coverage data run: yarn coverage