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 @@ -100,12 +100,17 @@ let startGraphQLServer (project : string) port (streamRef : DataRef<Stream>) =
100100
101101 System.Threading.Thread.Sleep ( 2000 )
102102
103- let runTests ( project : string ) ( args : string ) =
103+ let runTests ( project : string ) =
104+ let projectName = Path.GetFileNameWithoutExtension project
105+ let resultsFileName = $" {projectName}.trx"
106+
104107 DotNet.test
105108 ( fun options ->
106109 {
107110 options with
108111 NoBuild = true
112+ Logger = Some $" trx;LogFileName={resultsFileName}"
113+ ResultsDirectory = Some " test-results"
109114 Framework = Some DotNetMoniker
110115 Configuration = configuration
111116 MSBuildParams = {
@@ -225,11 +230,11 @@ Target.create BuildIntegrationTestsTarget <| fun _ ->
225230
226231let [<Literal>] RunUnitTestsTarget = " RunUnitTests"
227232Target.create RunUnitTestsTarget <| fun _ ->
228- runTests unitTestsProjectPath " "
233+ runTests unitTestsProjectPath
229234
230235let [<Literal>] RunIntegrationTestsTarget = " RunIntegrationTests"
231236Target.create RunIntegrationTestsTarget <| fun _ ->
232- runTests integrationTestsProjectPath " " //"--filter Execution=Sync"
237+ runTests integrationTestsProjectPath //"--filter Execution=Sync"
233238
234239let prepareDocGen () =
235240 Shell.rm " docs/release-notes.md"
You can’t perform that action at this time.
0 commit comments