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