-
Notifications
You must be signed in to change notification settings - Fork 74
Publish CI test results into PR discussions, harden artifact download, and add PR preview publishing #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
Merged
Merged
Publish CI test results into PR discussions, harden artifact download, and add PR preview publishing #570
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
239b68d
Migrate integration tests to in-process hosts via `WebApplicationFact…
Copilot bde4b5a
Enforce input/output kind safety for `ListOf`/`Nullable` wrappers at …
Copilot 966fda8
ci: publish test results to pull request discussions
Copilot e41355a
ci: tighten workflow permissions and resolve event file path
Copilot 0a8ea37
ci: update action-download-artifact to v6
Copilot eeb0eb5
ci: tolerate missing test-result artifacts in publish workflow
Copilot 35ae6c6
build: emit trx for introspection update test target
Copilot 1baf962
ci: fix artifact filter and enable explicit PR comment mode
Copilot 2fedc75
ci: add PR #570 test result preview publisher
Copilot eae8a16
ci: scope preview publishing to ubuntu trx artifact
Copilot 2ed8c77
fixup! ci: add PR #570 test result preview publisher
xperiandri 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
| 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
Oops, something went wrong.
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.