1- name : Build and test
1+ name : Build and Test Workflow
22
33on :
44 push :
55 branches : [ "master" ]
66 pull_request :
77 branches : [ "master" ]
88
9+ env :
10+ SOLUTION_PATH : src\NppJSONViewer.sln
11+ BUILD_DIR : src\Build\Bin
12+ MSBUILD_TOOLSET : v143
13+
914jobs :
1015 build :
1116 runs-on : windows-latest
@@ -20,36 +25,36 @@ jobs:
2025 - name : Checkout repo
2126 uses : actions/checkout@v4
2227 with :
23- submodules : recursive
28+ submodules : recursive
2429
2530 # Step 2: Prepare for build
26- - name : Pre Build
31+ - name : Setup MSBuild
2732 uses : microsoft/setup-msbuild@v2
2833
2934 # Step 3: Build projects and unit test
3035 - name : Build code
3136 working-directory : src
32- run : msbuild NppJSONViewer.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143"
37+ run : msbuild ${{ env.SOLUTION_PATH }} /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset=${{ env.MSBUILD_TOOLSET }}
3338
3439 # Step 4: Upload build binary artifacts for deployment
3540 - name : Archive binaries artifacts
3641 uses : actions/upload-artifact@v4
3742 with :
3843 name : NppJSONViewer_${{ matrix.build_platform}}_${{ matrix.build_configuration}}
39- path : src\Build\Bin \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.dll
44+ path : ${{ env.BUILD_DIR }} \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.dll
4045
4146 # Step 5: Upload build pdb artifacts
4247 - name : Archive symbols artifacts
4348 uses : actions/upload-artifact@v4
4449 with :
4550 name : NppJSONViewer_${{ matrix.build_platform}}_${{ matrix.build_configuration}}_pdb
46- path : src\Build\Bin \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.pdb
51+ path : ${{ env.BUILD_DIR }} \${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.pdb
4752
4853 # Step 6: Run unit tests for x86 and x64
4954 - name : Run unit tests
5055 if : matrix.build_platform == 'Win32' || matrix.build_platform == 'x64'
5156 run : |
52- cd src\Build\Bin \${{ matrix.build_configuration }}\${{ matrix.build_platform }}
57+ cd ${{ env.BUILD_DIR }} \${{ matrix.build_configuration }}\${{ matrix.build_platform }}
5358 ./UnitTest.exe
5459
5560 upload-full-artifacts :
0 commit comments