1
- name : Build and test
1
+ name : Build and Test Workflow
2
2
3
3
on :
4
4
push :
5
5
branches : [ "master" ]
6
6
pull_request :
7
7
branches : [ "master" ]
8
8
9
+ env :
10
+ SOLUTION_PATH : src\NppJSONViewer.sln
11
+ BUILD_DIR : src\Build\Bin
12
+ MSBUILD_TOOLSET : v143
13
+
9
14
jobs :
10
15
build :
11
16
runs-on : windows-latest
@@ -20,36 +25,36 @@ jobs:
20
25
- name : Checkout repo
21
26
uses : actions/checkout@v4
22
27
with :
23
- submodules : recursive
28
+ submodules : recursive
24
29
25
30
# Step 2: Prepare for build
26
- - name : Pre Build
31
+ - name : Setup MSBuild
27
32
uses : microsoft/setup-msbuild@v2
28
33
29
34
# Step 3: Build projects and unit test
30
35
- name : Build code
31
36
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 }}
33
38
34
39
# Step 4: Upload build binary artifacts for deployment
35
40
- name : Archive binaries artifacts
36
41
uses : actions/upload-artifact@v4
37
42
with :
38
43
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
40
45
41
46
# Step 5: Upload build pdb artifacts
42
47
- name : Archive symbols artifacts
43
48
uses : actions/upload-artifact@v4
44
49
with :
45
50
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
47
52
48
53
# Step 6: Run unit tests for x86 and x64
49
54
- name : Run unit tests
50
55
if : matrix.build_platform == 'Win32' || matrix.build_platform == 'x64'
51
56
run : |
52
- cd src\Build\Bin \${{ matrix.build_configuration }}\${{ matrix.build_platform }}
57
+ cd ${{ env.BUILD_DIR }} \${{ matrix.build_configuration }}\${{ matrix.build_platform }}
53
58
./UnitTest.exe
54
59
55
60
upload-full-artifacts :
0 commit comments