Skip to content

Commit 08abd77

Browse files
committed
Improve build workflow
1 parent e3a3aec commit 08abd77

File tree

1 file changed

+78
-42
lines changed

1 file changed

+78
-42
lines changed

.github/workflows/ci_build.yml

Lines changed: 78 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88

99
jobs:
1010
build:
11-
1211
runs-on: windows-latest
1312
strategy:
1413
fail-fast: false
@@ -17,45 +16,82 @@ jobs:
1716
build_platform: [Win32, x64, ARM64]
1817

1918
steps:
20-
# Step 1: Check out the code from the repo
21-
- name: Checkout repo
22-
uses: actions/checkout@v4
23-
with:
24-
submodules: recursive
25-
26-
# Step 2: Prepare for build
27-
- name: Pre Build
28-
uses: microsoft/setup-msbuild@v2
19+
# Step 1: Check out the code from the repo
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: recursive
24+
25+
# Step 2: Prepare for build
26+
- name: Pre Build
27+
uses: microsoft/setup-msbuild@v2
2928

30-
# Step 3: Build projects and unit test
31-
- name: Build
32-
working-directory: src
33-
run: msbuild NppJSONViewer.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143"
34-
35-
# Step 4: Upload build binary artifacts
36-
- name: Archive binaries artifacts
37-
uses: actions/upload-artifact@v4
38-
with:
39-
name: ${{ matrix.build_platform}}_${{ matrix.build_configuration}}
40-
path: src\Build\Bin\${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.dll
41-
42-
# Step 5: Upload build pdb artifacts
43-
- name: Archive symbols artifacts
44-
uses: actions/upload-artifact@v4
45-
with:
46-
name: ${{ matrix.build_platform}}_${{ matrix.build_configuration}}_pdb
47-
path: src\Build\Bin\${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.pdb
48-
49-
# Step 6: Run unit tests for x86 | Release
50-
- name: Run tests x86 | Release
51-
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release'
52-
run: |
53-
cd src\Build\Bin\Release\Win32
54-
./UnitTest.exe
55-
56-
# Step 7: Run unit tests for x64 | Release
57-
- name: Run tests x64 | Release
58-
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
59-
run: |
60-
cd src\Build\Bin\Release\x64
61-
./UnitTest.exe
29+
# Step 3: Build projects and unit test
30+
- name: Build code
31+
working-directory: src
32+
run: msbuild NppJSONViewer.sln /m /p:configuration="${{ matrix.build_configuration }}" /p:platform="${{ matrix.build_platform }}" /p:PlatformToolset="v143"
33+
34+
# Step 4: Upload build binary artifacts for deployment
35+
- name: Archive binaries artifacts
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: NppJSONViewer_${{ matrix.build_platform}}_${{ matrix.build_configuration}}
39+
path: src\Build\Bin\${{ matrix.build_configuration}}\${{ matrix.build_platform}}\NPPJSONViewer.dll
40+
41+
# Step 5: Upload build artifacts with pdb for reference
42+
- name: Archive full artifacts
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: NppJSONViewer_Build_artifacts_full
46+
path: |
47+
src/Build/Bin/Release/Win32/NPPJSONViewer.dll
48+
src/Build/Bin/Release/Win32/NPPJSONViewer.pdb
49+
src/Build/Bin/Release/x64/NPPJSONViewer.dll
50+
src/Build/Bin/Release/x64/NPPJSONViewer.pdb
51+
src/Build/Bin/Release/Arm64/NPPJSONViewer.dll
52+
src/Build/Bin/Release/Arm64/NPPJSONViewer.pdb
53+
src/Build/Bin/Debug/Win32/NPPJSONViewer.dll
54+
src/Build/Bin/Debug/Win32/NPPJSONViewer.pdb
55+
src/Build/Bin/Debug/x64/NPPJSONViewer.dll
56+
src/Build/Bin/Debug/x64/NPPJSONViewer.pdb
57+
src/Build/Bin/Debug/Arm64/NPPJSONViewer.dll
58+
src/Build/Bin/Debug/Arm64/NPPJSONViewer.pdb
59+
60+
# Step 6: Run unit tests for x86 | Release
61+
- name: Run unit tests x86 | Release
62+
if: matrix.build_platform == 'Win32' && matrix.build_configuration == 'Release'
63+
run: |
64+
cd src\Build\Bin\Release\Win32
65+
./UnitTest.exe
66+
67+
# Step 7: Run unit tests for x64 | Release
68+
- name: Run unit tests x64 | Release
69+
if: matrix.build_platform == 'x64' && matrix.build_configuration == 'Release'
70+
run: |
71+
cd src\Build\Bin\Release\x64
72+
./UnitTest.exe
73+
74+
75+
I want to have all the artifacts at one place like
76+
77+
NppJSONViewer_Build_artifacts_full
78+
--- Release
79+
|-- win32
80+
|-- NPPJSONViewer.dll
81+
|-- NPPJSONViewer.pdb
82+
|-- x64
83+
|-- NPPJSONViewer.dll
84+
|-- NPPJSONViewer.pdb
85+
|-- Arm64
86+
|-- NPPJSONViewer.dll
87+
|-- NPPJSONViewer.pdb
88+
--- Debug
89+
|-- win32
90+
|-- NPPJSONViewer.dll
91+
|-- NPPJSONViewer.pdb
92+
|-- x64
93+
|-- NPPJSONViewer.dll
94+
|-- NPPJSONViewer.pdb
95+
|-- Arm64
96+
|-- NPPJSONViewer.dll
97+
|-- NPPJSONViewer.pdb

0 commit comments

Comments
 (0)