Skip to content

Commit aeed4b2

Browse files
committed
test fix
1 parent 033f5f1 commit aeed4b2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/ci-badges.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ jobs:
3030
run: dotnet build ${{ env.solutionPath }} --configuration Release --no-restore
3131
- name: Execute unit tests
3232
run: dotnet test ${{ env.solutionPath }} --configuration Release --settings ${{ env.solutionFolder }}/Console.Tests/CodeCoverage.runsettings --no-build --logger trx --no-restore --results-directory "TestResults" --collect:"XPlat code coverage"
33-
- name: Publish Test Report
34-
uses: phoenix-actions/test-reporting@v8
35-
id: test-report # Set ID reference for step
36-
if: ${{ (success() || failure()) && (github.event_name == 'pull_request') }} # run this step even if previous step failed
37-
with:
38-
name: unit tests # Name of the check run which will be created
39-
path: TestResults/*.trx # Path to test results
40-
reporter: dotnet-trx # Format of test results
33+
- name: Get first subfolder name
34+
id: get_subfolder
35+
shell: pwsh
36+
run: |
37+
$folderPath = 'your/folder/path'
38+
$firstSubfolder = Get-ChildItem -Path $folderPath -Directory | Select-Object -First 1
39+
$name = if ($firstSubfolder) { $firstSubfolder.Name } else { "" }
40+
echo "subfolder_name=$name" >> $env:GITHUB_OUTPUT
4141
- name: Create Test Coverage Badge
4242
uses: simon-k/[email protected]
4343
id: create_coverage_badge
4444
with:
4545
label: Unit Test Coverage
4646
color: brightgreen
47-
path: TestResults/*/coverage.opencover.xml
47+
path: TestResults/${{ steps.get_subfolder.outputs.subfolder_name }}/coverage.opencover.xml
4848
gist-filename: code-coverage.json
4949
gist-id: ${{ env.GIST_REPO_ID }}
5050
gist-auth-token: ${{ secrets.GIST_AUTH_TOKEN }}

0 commit comments

Comments
 (0)