-
Notifications
You must be signed in to change notification settings - Fork 75
Publish CI test results into PR discussions and harden artifact download action #570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
9
commits into
dev
Choose a base branch
from
copilot/publish-test-results-to-pr
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5f5eff4
Migrate integration tests to in-process hosts via `WebApplicationFact…
Copilot 022d633
Enforce input/output kind safety for `ListOf`/`Nullable` wrappers at …
Copilot 24902f1
Pin CI workflows and build script to .NET SDK 10.0.300 (#578)
Copilot 49f6f49
ci: publish test results to pull request discussions
Copilot c3c9adf
ci: tighten workflow permissions and resolve event file path
Copilot a347a1c
ci: update action-download-artifact to v6
Copilot 80c801b
ci: tolerate missing test-result artifacts in publish workflow
Copilot 857933c
build: emit trx for introspection update test target
Copilot 1cf3cef
ci: fix artifact filter and enable explicit PR comment mode
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| name: Publish Test Results | ||
|
|
||
| on: | ||
| workflow_run: | ||
| workflows: ["Build and Test"] | ||
| types: | ||
| - completed | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| test-results: | ||
| if: github.event.workflow_run.conclusion != 'skipped' && github.event.workflow_run.event == 'pull_request' | ||
| name: Test Results | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| actions: read | ||
| checks: write | ||
| pull-requests: write | ||
|
|
||
| steps: | ||
| - name: Download event file | ||
| uses: dawidd6/action-download-artifact@v6 | ||
| with: | ||
| run_id: ${{ github.event.workflow_run.id }} | ||
| path: artifacts | ||
| name: EventFile | ||
|
|
||
| - name: Download test results | ||
| uses: dawidd6/action-download-artifact@v6 | ||
| with: | ||
| run_id: ${{ github.event.workflow_run.id }} | ||
| path: test-results | ||
| name: ^test-results-.* | ||
| name_is_regexp: true | ||
| if_no_artifact_found: warn | ||
|
|
||
| - name: Resolve event file path | ||
| id: event_file | ||
| shell: pwsh | ||
| run: | | ||
| $eventFilePath = | ||
| Get-ChildItem -Path artifacts -Filter event.json -Recurse | | ||
| Select-Object -First 1 -ExpandProperty FullName | ||
|
|
||
| if ($null -eq $eventFilePath) { | ||
| throw "event.json file was not found in downloaded artifacts" | ||
| } | ||
|
|
||
| "path=$eventFilePath" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append | ||
|
|
||
| - name: Publish test results | ||
| if: ${{ hashFiles('test-results/**/*.trx') != '' }} | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| with: | ||
| commit: ${{ github.event.workflow_run.head_sha }} | ||
| comment_mode: always | ||
| event_file: ${{ steps.event_file.outputs.path }} | ||
| event_name: ${{ github.event.workflow_run.event }} | ||
| files: "test-results/**/*.trx" | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot what does it mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means the workflow would publish only a check unless PR comment publishing is enabled/configured. I updated it in commit 1cf3cef by setting
comment_mode: always, so PR discussion comments are explicitly enabled. No UI changes were made, so there is no screenshot.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means PR-discussion comments were not explicitly configured in the publish step. Commit 1cf3cef now sets
comment_mode: always, making PR commenting explicit alongside check publication. No UI changes were made, so there is no screenshot.