Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions restore-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
28 changes: 10 additions & 18 deletions test-dotnet/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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)