File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish Test Results
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Build and Test"]
6+ types :
7+ - completed
8+
9+ permissions : {}
10+
11+ jobs :
12+ test-results :
13+ if : github.event.workflow_run.conclusion != 'skipped' && github.event.workflow_run.event == 'pull_request'
14+ name : Test Results
15+ runs-on : ubuntu-latest
16+
17+ permissions :
18+ actions : read
19+ checks : write
20+ pull-requests : write
21+
22+ steps :
23+ - name : Download event file
24+ uses : dawidd6/action-download-artifact@v4
25+ with :
26+ run_id : ${{ github.event.workflow_run.id }}
27+ path : artifacts
28+ name : EventFile
29+
30+ - name : Download test results
31+ uses : dawidd6/action-download-artifact@v4
32+ with :
33+ run_id : ${{ github.event.workflow_run.id }}
34+ path : test-results
35+ pattern : test-results-*
36+
37+ - name : Publish test results
38+ uses : EnricoMi/publish-unit-test-result-action@v2
39+ with :
40+ commit : ${{ github.event.workflow_run.head_sha }}
41+ event_file : artifacts/event.json
42+ event_name : ${{ github.event.workflow_run.event }}
43+ files : " test-results/**/*.trx"
Original file line number Diff line number Diff line change 1515 DOTNET_NOLOGO : true
1616
1717jobs :
18+ event_file :
19+ if : github.event_name == 'pull_request'
20+ name : Publish event file
21+ runs-on : ubuntu-latest
22+ steps :
23+ - name : Upload event file
24+ uses : actions/upload-artifact@v4
25+ with :
26+ name : EventFile
27+ path : ${{ github.event_path }}
28+
1829 build :
1930
2031 strategy :
5061
5162 - name : Build and run integration tests
5263 run : dotnet run --project build/Build.fsproj --launch-profile BuildAndTest
64+
65+ - name : Upload test results
66+ if : always()
67+ uses : actions/upload-artifact@v4
68+ with :
69+ name : test-results-${{ matrix.os }}
70+ path : test-results
Original file line number Diff line number Diff line change @@ -98,12 +98,17 @@ let startGraphQLServer (project : string) port (streamRef : DataRef<Stream>) =
9898
9999 System.Threading.Thread.Sleep ( 2000 )
100100
101- let runTests ( project : string ) ( args : string ) =
101+ let runTests ( project : string ) =
102+ let projectName = Path.GetFileNameWithoutExtension project
103+ let resultsFileName = $" {projectName}.trx"
104+
102105 DotNet.test
103106 ( fun options ->
104107 {
105108 options with
106109 NoBuild = true
110+ Logger = Some $" trx;LogFileName={resultsFileName}"
111+ ResultsDirectory = Some " test-results"
107112 Framework = Some DotNetMoniker
108113 Configuration = configuration
109114 MSBuildParams = {
@@ -184,7 +189,7 @@ let unitTestsProjectPath =
184189
185190let [<Literal>] RunUnitTestsTarget = " RunUnitTests"
186191Target.create RunUnitTestsTarget <| fun _ ->
187- runTests unitTestsProjectPath " "
192+ runTests unitTestsProjectPath
188193
189194let prepareDocGen () =
190195 Shell.rm " docs/release-notes.md"
You can’t perform that action at this time.
0 commit comments