@@ -2,63 +2,56 @@ name: Windows Build Test
22
33on :
44 push :
5- branches : [ '*' ]
5+ branches : ['*']
66 pull_request :
7- branches : [ '*' ]
8-
9- env :
10- # Path to the solution file relative to the root of the project.
11- WOLFSSL_SOLUTION_FILE_PATH : wolfssl/wolfssl64.sln
12- SOLUTION_FILE_PATH : wolfclu.sln
13- USER_SETTINGS_H_NEW : wolfclu/ide/winvs/user_settings.h
14- USER_SETTINGS_H : wolfssl/IDE/WIN/user_settings.h
15- INCLUDE_DIR : wolfclu
16-
17- # Configuration type to build.
18- # You can convert this to a build matrix if you need coverage of multiple configuration types.
19- # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20- WOLFSSL_BUILD_CONFIGURATION : Release
21- WOLFCLU_BUILD_CONFIGURATION : Release
22- BUILD_PLATFORM : x64
23- TARGET_PLATFORM : 10
7+ branches : ['*']
248
259jobs :
2610 build :
2711 runs-on : windows-latest
12+ timeout-minutes : 10
13+
14+ env :
15+ BUILD_PLATFORM : x64
16+ BUILD_CONFIGURATION : Release
2817
2918 steps :
30- - uses : actions/checkout@v2
31- with :
32- repository : wolfssl/wolfssl
33- path : wolfssl
34-
35- - uses : actions/checkout@master
36- with :
37- path : wolfclu
38-
39- - name : Add MSBuild to PATH
40- uses : microsoft/setup-msbuild@v1
19+ - uses : actions/checkout@v4
20+ with :
21+ repository : wolfssl/wolfssl
22+ ref : master
23+ path : wolfssl
24+
25+ - uses : actions/checkout@v4
26+ with :
27+ path : wolfclu
28+
29+ - name : Add MSBuild to PATH
30+ uses : microsoft/setup-msbuild@v2
31+
32+ - name : Replace user_settings.h
33+ run : cp wolfclu/ide/winvs/user_settings.h wolfssl/IDE/WIN/user_settings.h
34+
35+ - name : Detect platform toolset
36+ id : toolset
37+ run : |
38+ $major = (vswhere -latest -property installationVersion).Split('.')[0]
39+ $toolsets = @{ "16" = "v142"; "17" = "v143"; "18" = "v145" }
40+ $ts = $toolsets[$major]
41+ if (-not $ts) {
42+ Write-Error "Unsupported Visual Studio major version '$major'."
43+ exit 1
44+ }
45+ echo "value=$ts" >> $env:GITHUB_OUTPUT
46+
47+ - name : Build wolfSSL
48+ run : msbuild /m /p:PlatformToolset=${{ steps.toolset.outputs.value }} /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfssl/wolfssl64.sln
49+
50+ - name : Build wolfCLU
51+ working-directory : wolfclu
52+ run : msbuild /m /p:Platform=${{ env.BUILD_PLATFORM }} /p:Configuration=${{ env.BUILD_CONFIGURATION }} wolfclu.sln
4153
42- - name : Restore wolfSSL NuGet packages
43- working-directory : ${{env.GITHUB_WORKSPACE}}
44- run : nuget restore ${{env.WOLFSSL_SOLUTION_FILE_PATH}}
45-
46- - name : replace with wolfCLU user_settings.h
47- working-directory : ${{env.GITHUB_WORKSPACE}}
48- run : cp ${{env.USER_SETTINGS_H_NEW}} ${{env.USER_SETTINGS_H}}
49-
50- - name : Build wolfssl
51- working-directory : ${{env.GITHUB_WORKSPACE}}
52- # Add additional options to the MSBuild command line here (like platform or verbosity level).
53- # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
54- run : msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:WindowsTargetPlatformVersion=${{env.TARGET_PLATFORM}} /p:Configuration=${{env.WOLFSSL_BUILD_CONFIGURATION}} ${{env.WOLFSSL_SOLUTION_FILE_PATH}}
54+ - name : Run tests
55+ working-directory : wolfclu
56+ run : python tests/run_tests.py
5557
56- - name : Restore NuGet packages
57- working-directory : ${{env.GITHUB_WORKSPACE}}wolfclu
58- run : nuget restore ${{env.SOLUTION_FILE_PATH}}
59-
60- - name : Build
61- working-directory : ${{env.GITHUB_WORKSPACE}}wolfclu
62- # Add additional options to the MSBuild command line here (like platform or verbosity level).
63- # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
64- run : msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:WindowsTargetPlatformVersion=${{env.TARGET_PLATFORM}} /p:Configuration=${{env.WOLFCLU_BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
0 commit comments