@@ -12,14 +12,27 @@ jobs:
1212    strategy :
1313      matrix :
1414        os : [ windows-latest, macos-latest, ubuntu-latest ] 
15+         dotnet-version : [ net472, net6.0, net8.0] 
1516        node-version : [ 18.x, 20.x ] 
1617        configuration : [ Release ] 
18+         exclude :
19+           #  Exclude Node 18.x on .NET < 8, to thin the matrix.
20+           - dotnet-version : net6.0 
21+             node-version : 18.x 
22+           - dotnet-version : net472 
23+             node-version : 18.x 
24+           #  Exclude .NET 4.x on non-Windows OS.
25+           - os : macos-latest 
26+             dotnet-version : net472  
27+           - os : ubuntu-latest 
28+             dotnet-version : net472 
29+ 
1730      fail-fast : false   #  Don't cancel other jobs when one job fails
1831
1932    runs-on : ${{ matrix.os }} 
2033
2134    steps :
22-     - uses : actions/checkout@v3  
35+     - uses : actions/checkout@v4  
2336      with :
2437        fetch-depth : 0  #  Deep clone is required for versioning on git commit height
2538
@@ -28,23 +41,21 @@ jobs:
2841      run : sudo ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so 
2942
3043    - name : Setup .NET 6 
31-       uses : actions/setup-dotnet@v3  
44+       uses : actions/setup-dotnet@v4  
3245      with :
3346        dotnet-version : 6.0.x 
3447
48+     #  The .NET 8 SDK is required even when the build matrix targets other .NET versions.
3549    - name : Setup .NET 8 
36-       uses : actions/setup-dotnet@v3  
50+       uses : actions/setup-dotnet@v4  
3751      with :
3852        dotnet-version : 8.0.x 
3953
4054    - name : Setup Node.js ${{ matrix.node-version }} 
41-       uses : actions/setup-node@v3  
55+       uses : actions/setup-node@v4  
4256      with :
4357        node-version : ${{ matrix.node-version }} 
4458
45-     - name : Build ${{ matrix.configuration }} 
46-       run : dotnet build --configuration ${{ matrix.configuration }} 
47- 
4859    - name : Build packages 
4960      id : pack 
5061      run : dotnet pack --configuration ${{ matrix.configuration }} 
@@ -56,48 +67,29 @@ jobs:
5667    #       limit-access-to-actor: true
5768
5869    - name : Upload build artifacts 
59-       uses : actions/upload-artifact@v3 
70+       if : matrix.dotnet-version == 'net8.0' && matrix.node-version == '20.x' 
71+       uses : actions/upload-artifact@v4 
6072      with :
6173        name : ${{ matrix.os }}-${{ matrix.configuration }}-packages 
6274        path : | 
6375          out/pkg/*.nupkg 
6476          out/pkg/*.tgz 
6577
66-      - name : Test .NET 4.7.2 
67-       if : matrix.os == 'windows-latest' && steps.pack.conclusion == 'success' && !cancelled() 
68-       env :
69-         TRACE_NODE_API_HOST : 1 
70-       run : > 
71-         dotnet test -f net472 
72-         --configuration ${{ matrix.configuration }} 
73-         --logger trx 
74-         --results-directory "out/test/netfx47-node${{ matrix.node-version }}-${{ matrix.configuration }}" 
75- 
76-      - name : Test .NET 6 
77-       if : steps.pack.conclusion == 'success' && !cancelled() 
78-       env :
79-         TRACE_NODE_API_HOST : 1 
80-       run : > 
81-         dotnet test -f net6.0 
82-         --configuration ${{ matrix.configuration }} 
83-         --logger trx 
84-         --results-directory "out/test/dotnet6-node${{ matrix.node-version }}-${{ matrix.configuration }}" 
85- 
86-      - name : Test .NET 8 
78+      - name : Test 
8779      if : steps.pack.conclusion == 'success' && !cancelled() 
8880      env :
8981        TRACE_NODE_API_HOST : 1 
9082      run : > 
91-         dotnet test -f net8.0  
83+         dotnet test -f ${{ matrix.dotnet-version }}  
9284        --configuration ${{ matrix.configuration }} 
9385        --logger trx 
94-         --results-directory "out/test/dotnet8-node${{ matrix.node-version }}-${{ matrix.configuration }}" 
86+         --results-directory "out/test/${{matrix.dotnet-version}}-node${{matrix.node-version}}-${{matrix.configuration}}" 
87+        continue-on-error : true 
9588
9689    - name : Upload test logs 
97-       if : always()  #  Update artifacts regardless if code succeeded, failed, or cancelled
98-       uses : actions/upload-artifact@v3 
90+       uses : actions/upload-artifact@v4 
9991      with :
100-         name : test-logs-${{ matrix.os }}-node${{  matrix.node-version  }}-${{  matrix.configuration  }} 
92+         name : test-logs-${{ matrix.os }}-${{matrix.dotnet-version}}- node${{matrix.node-version}}-${{matrix.configuration}} 
10193        path : | 
10294          out/obj/${{ matrix.configuration }}/**/*.log 
10395          out/obj/${{ matrix.configuration }}/**/*.rsp 
0 commit comments