1- name : Build and test
1+ name : Build and Test
22
33on :
44 push :
55 branches : [ "master" ]
66 pull_request :
77 branches : [ "master" ]
88
9+ env :
10+ BUILD_DIR : src\Build\Bin
11+ MSBUILD_TOOLSET : v143
12+
913jobs :
1014 build :
1115 runs-on : windows-latest
@@ -20,36 +24,36 @@ jobs:
2024 - name : Checkout repo
2125 uses : actions/checkout@v4
2226 with :
23- submodules : recursive
27+ submodules : recursive
2428
2529 # Step 2: Prepare for build
26- - name : Pre Build
30+ - name : Setup MSBuild
2731 uses : microsoft/setup-msbuild@v2
2832
2933 # Step 3: Build projects and unit test
3034 - name : Build code
3135 working-directory : src
32- run : msbuild NppJSONViewer.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143"
36+ run : msbuild NppJSONViewer.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset=${{ env.MSBUILD_TOOLSET }}
3337
3438 # Step 4: Upload build binary artifacts for deployment
3539 - name : Archive binaries artifacts
3640 uses : actions/upload-artifact@v4
3741 with :
3842 name : NppJSONViewer_${{ matrix.build_platform}}_${{ matrix.build_configuration}}
39- path : src\Build\Bin \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.dll
43+ path : ${{ env.BUILD_DIR }} \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.dll
4044
4145 # Step 5: Upload build pdb artifacts
4246 - name : Archive symbols artifacts
4347 uses : actions/upload-artifact@v4
4448 with :
4549 name : NppJSONViewer_${{ matrix.build_platform}}_${{ matrix.build_configuration}}_pdb
46- path : src\Build\Bin \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.pdb
50+ path : ${{ env.BUILD_DIR }} \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.pdb
4751
4852 # Step 6: Run unit tests for x86 and x64
4953 - name : Run unit tests
5054 if : matrix.build_platform == 'Win32' || matrix.build_platform == 'x64'
5155 run : |
52- cd src\Build\Bin \${{ matrix.build_configuration }}\${{ matrix.build_platform }}
56+ cd ${{ env.BUILD_DIR }} \${{ matrix.build_configuration }}\${{ matrix.build_platform }}
5357 ./UnitTest.exe
5458
5559 upload-full-artifacts :
0 commit comments