Skip to content

Specify dotnet version in global.json #9

Specify dotnet version in global.json

Specify dotnet version in global.json #9

name: 'Reproduce dotnet-coverage crash'
on:
push:
branches: [main]
workflow_dispatch:
jobs:
repro:
strategy:
fail-fast: false
matrix:
dotnet-coverage-version: ['17.1.2', '17.2.0', '17.8.6']
dotnet-version: ['3.1.426', '5.0.408', '6.0.414', '7.0.401', '8.0.100-rc.1.23463.5']
runs-on: [ ubuntu-latest ]
steps:
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: install GDB
run: |
sudo apt-get update
sudo apt-get install -y gdb
- name: Install dotnet-coverage
run: |
dotnet tool update dotnet-coverage --version ${{ matrix.dotnet-coverage-version }} --tool-path ./coverage
- name: Enable core dumps
run: |
sudo mkdir /cores
sudo chmod 777 /cores
sudo bash -c 'echo "/cores/%e.%p.%t" > /proc/sys/kernel/core_pattern'
- name: Start dotnet-coverage
run: |
ulimit -c unlimited
cat <<EOT >> global.json
{
"sdk": {
"version": "${{ matrix.dotnet-version }}"
}
}
EOT
# Workaround for version 17.2.0 which always exits with 0, even if an exception is raised
OUTPUT=$(./coverage/dotnet-coverage collect "dotnet --version" 2>&1 | tee /dev/stderr)
if [[ $OUTPUT = *Exception* ]]
then
exit 139
fi
- name: print stacktrace
if: failure()
run: |
gdb -ex bt -ex quit $(which dotnet) $(find /cores/ -name dotnet.*)