diff --git a/restore-dotnet/action.yml b/restore-dotnet/action.yml index f1e694df..ac19ecdb 100644 --- a/restore-dotnet/action.yml +++ b/restore-dotnet/action.yml @@ -24,10 +24,10 @@ runs: - name: Add Trakx github nuget source shell: bash run: dotnet nuget add source "https://nuget.pkg.github.com/trakx/index.json" - --name "github" - --username "trakx-bot" - --password ${{inputs.packageReadonlyPat}} - --store-password-in-clear-text + --name "github" + --username "trakx-bot" + --password ${{inputs.packageReadonlyPat}} + --store-password-in-clear-text - name: Restore Cache uses: actions/cache@v4 @@ -38,10 +38,9 @@ runs: - name: .NET Restore packages shell: bash - run: | - for f in $(find . -name "*.sln"); do echo "restoring solution $f" && \ - dotnet restore $f --locked-mode - done + env: + DOTNET_NUGET_SIGNATURE_VERIFICATION: false + run: dotnet restore --locked-mode - name: Remove Trakx github source shell: bash diff --git a/test-dotnet/action.yml b/test-dotnet/action.yml index a6b83d1b..3d6acc6a 100644 --- a/test-dotnet/action.yml +++ b/test-dotnet/action.yml @@ -44,17 +44,12 @@ runs: - name: Restore and cache private nuget packages uses: ./github-actions-test-dotnet/restore-dotnet + env: + DOTNET_NOLOGO: true with: dotnetVersion: ${{inputs.dotnetVersion}} packageReadonlyPat: ${{inputs.packageReadonlyPat}} - - name: .NET Build - shell: bash - run: | - for f in $(find . -name "*.sln"); do echo "restoring solution $f" && \ - dotnet build $f --configuration Debug --no-restore - done - - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@v4.0.1 with: @@ -66,12 +61,12 @@ runs: # coverlet.msbuild nuget package should be installed to generate coverage report - name: .NET Test shell: bash - run: | - for f in $(find . -name "*.Tests.csproj"); do echo "testing project $f" && \ - csprojName=${f##*/} && \ - projectName="${csprojName/.csproj/}" && \ - dotnet test $f --configuration Debug --no-build --logger GitHubActions --collect "XPlat Code Coverage" --results-directory "TestResults/$projectName" - done + run: dotnet test + --no-restore + --configuration Debug + --logger GitHubActions + --collect "XPlat Code Coverage" + --results-directory "TestResults/" # .NET Test puts the coverage file under a random directory [Guid]/coverage.cobertura.xml # That's why we locate the coverage file first and pass it to the upload script @@ -80,8 +75,5 @@ runs: env: CODACY_PROJECT_TOKEN: ${{inputs.codacyToken}} run: | - for f in $(find ./TestResults -name "coverage.cobertura.xml"); do echo "sending coverage report $f" && \ - bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l csharp -r $f \ - --partial; \ - done - bash <(curl -Ls https://coverage.codacy.com/get.sh) final + bash <(curl -Ls https://coverage.codacy.com/get.sh) report -l csharp \ + $(find ./TestResults -name 'coverage.cobertura.xml' | sed 's,^, -r ,' | xargs echo)