Add workaround for wrong exit code #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Reproduce dotnet-coverage crash' | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
repro-with-latest-version-and-dotnet-6: | |
strategy: | |
fail-fast: false | |
matrix: | |
dotnet-coverage-version: ['17.1.2', '17.2.0', '17.8.6'] | |
dotnet-version: ['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 | |
OUTPUT=$(./coverage/dotnet-coverage collect "dotnet --version" 2>&1 | tee /dev/stderr) | |
if [[ $OUTPUT = *Exception* ]] | |
then | |
exit 1 | |
fi | |
- name: print stacktrace | |
if: failure() | |
run: | | |
gdb -ex bt -ex quit $(which dotnet) $(find /cores/ -name dotnet.*) |