Commit 6a61fe7
Enable TUnit test report artifact upload in GitHub Actions (#902)
TUnit can automatically upload HTML test reports as workflow artifacts
and link them in the step summary when running in GitHub Actions — but
only if `ACTIONS_RUNTIME_TOKEN` is available to the shell process, which
it isn't by default (it's only exposed inside JS/Docker action
handlers).
## Changes
- Added an **"Expose GitHub Actions Runtime"** step using
`actions/github-script@v7` immediately before the `dotnet test` step in
both workflow files:
- `.github/workflows/PR-Build-And-Test.yml`
- `.github/workflows/Build-Test-And-Deploy.yml`
```yaml
- name: Expose GitHub Actions Runtime
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN']);
core.exportVariable('ACTIONS_RESULTS_URL', process.env['ACTIONS_RESULTS_URL']);
- name: Run .NET Tests
run: dotnet test ...
```
With this in place, TUnit will upload the test report as a workflow
artifact and add a direct link to it in the step summary on each run.
<!-- START COPILOT CODING AGENT TIPS -->
---
💬 We'd love your input! Share your thoughts on Copilot coding agent in
our [2 minute survey](https://gh.io/copilot-coding-agent-survey).
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>1 parent 8c0f329 commit 6a61fe7
2 files changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
| |||
0 commit comments