fx
This commit is contained in:
@@ -9,6 +9,8 @@ jobs:
|
||||
build:
|
||||
name: Build and analyze
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PATH: ${{ env.PATH }}:/root/.dotnet/tools
|
||||
steps:
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
@@ -29,8 +31,12 @@ jobs:
|
||||
- name: Install coverlet.collector
|
||||
run: |
|
||||
dotnet tool install --global coverlet.console
|
||||
echo "Adding .dotnet/tools to PATH..."
|
||||
echo 'export PATH="$PATH:/root/.dotnet/tools"' >> ~/.bashrc
|
||||
export PATH="$PATH:/root/.dotnet/tools"
|
||||
echo "Coverlet installed at:"
|
||||
which coverlet
|
||||
which coverlet || echo "Coverlet not found, trying full path..."
|
||||
ls -la /root/.dotnet/tools/ | grep coverlet || echo "No coverlet in tools directory"
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore --verbosity normal
|
||||
- name: SonarQube begin
|
||||
@@ -58,6 +64,8 @@ jobs:
|
||||
echo "Trying to run coverlet..."
|
||||
if coverlet ./ChatBot.Tests/bin/Debug/net9.0/ChatBot.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml"; then
|
||||
echo "Coverlet succeeded"
|
||||
elif /root/.dotnet/tools/coverlet ./ChatBot.Tests/bin/Debug/net9.0/ChatBot.Tests.dll --target "dotnet" --targetargs "test --no-build" -f=opencover -o="coverage.xml"; then
|
||||
echo "Coverlet succeeded with full path"
|
||||
else
|
||||
echo "Coverlet failed, trying built-in coverage collection..."
|
||||
dotnet test --collect:"XPlat Code Coverage" --results-directory ./TestResults
|
||||
|
||||
Reference in New Issue
Block a user