11name : test vsdevenv-shell
22on :
33 push :
4+ workflow_dispatch :
5+ inputs :
6+ extra_tests :
7+ description : ' Enable additional CI settings'
8+ required : false
9+ default : false
410jobs :
511 test-vsdevenv-shell :
6- runs-on : windows-latest
12+ strategy :
13+ matrix :
14+ os : [ windows-2019, windows-2022, ubuntu-latest, macOS-latest ]
15+ runs-on : ${{ matrix.os }}
716 steps :
17+ - name : set VISUAL_STUDIO_GENERATOR
18+ if : ${{ runner.os == 'Windows' }}
19+ shell : bash
20+ run : |
21+ if grep 2019 /c/imagedata.json ; then
22+ echo "VISUAL_STUDIO_GENERATOR=Visual Studio 16 2019" | tee -a $GITHUB_ENV
23+ else #if grep 2019 /c/imagedata.json ;
24+ echo "VISUAL_STUDIO_GENERATOR=Visual Studio 17 2022" | tee -a $GITHUB_ENV
25+ fi
826 - uses : actions/checkout@v2
927 - uses : ./
1028
29+ - name : Setup tmate session
30+ if : ${{ contains(github.event.inputs.extra_tests, format('tmate-{0}', runner.os)) }}
31+ 32+ with :
33+ limit-access-to-actor : true
34+
1135 - name : an earlier build step
1236 shell : bash
1337 run : |
1438 echo "clean job environment (no dev tools)"
1539 echo "$(env | wc -l) environment variables defined"
1640
1741 - name : specific step (executed within vsdevcmd.bat environment)
42+ continue-on-error : ${{ runner.os != 'Windows' }}
1843 shell : vsdevenv x64 bash {0}
1944 run : |
2045 echo "$(env | wc -l) environment variables defined"
@@ -32,22 +57,27 @@ jobs:
3257 run : echo test 1 2 3
3358
3459 - name : Verify MSVC wrapper -- bash
60+ continue-on-error : ${{ runner.os != 'Windows' }}
3561 shell : vsdevenv x64 bash {0}
3662 run : cl
3763
3864 - name : Verify MSVC wrapper -- cmd
65+ continue-on-error : ${{ runner.os != 'Windows' }}
3966 shell : vsdevenv x86 cmd {0}
4067 run : cl
4168
4269 - name : Verify MSVC wrapper -- powershell
70+ continue-on-error : ${{ runner.os != 'Windows' }}
4371 shell : vsdevenv arm64 powershell {0}
4472 run : cl
4573
4674 - name : Verify MSVC wrapper -- pwsh
75+ continue-on-error : ${{ runner.os != 'Windows' }}
4776 shell : vsdevenv arm64 pwsh {0}
4877 run : cl
4978
5079 - name : cmake test -- vsdevenv x64 cmd
80+ continue-on-error : ${{ runner.os != 'Windows' }}
5181 shell : vsdevenv x64 cmd {0}
5282 run : |
5383 cmake -G "NMake Makefiles" -B tests\build-x64 -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. || exit /b %errorlevel%
@@ -56,14 +86,16 @@ jobs:
5686 tests\build-x64\helloworld.exe 1 2 3 4
5787
5888 - name : cmake test -- vsdevenv x64 bash -A x64
89+ continue-on-error : ${{ runner.os != 'Windows' }}
5990 shell : vsdevenv x64 bash {0}
6091 run : |
61- cmake -A x64 -G "Visual Studio 16 2019 " -B tests/build-Ax64 -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=.
92+ cmake -A x64 -G "$VISUAL_STUDIO_GENERATOR " -B tests/build-Ax64 -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=.
6293 cmake --build tests/build-Ax64 --config release
6394 ls -l tests/build-Ax64/helloworld.exe
6495 ./tests/build-Ax64/helloworld.exe 1 2 3 4
6596
6697 - name : cmake test -- vsdevenv x86 powershell
98+ continue-on-error : ${{ runner.os != 'Windows' }}
6799 shell : vsdevenv x86 powershell {0}
68100 run : |
69101 cmake -G "NMake Makefiles" -B tests\build-x86 -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=.
@@ -72,9 +104,10 @@ jobs:
72104 tests\build-x86\helloworld.exe 1 2 3 4
73105
74106 - name : cmake test -- vsdevenv x86 cmd -A Win32
107+ continue-on-error : ${{ runner.os != 'Windows' }}
75108 shell : vsdevenv x86 cmd {0}
76109 run : |
77- cmake -A Win32 -G "Visual Studio 16 2019 " -B tests\build-Ax86 -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. || exit /b %errorlevel%
110+ cmake -A Win32 -G "$VISUAL_STUDIO_GENERATOR " -B tests\build-Ax86 -S tests -DCMAKE_BUILD_TYPE=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=. || exit /b %errorlevel%
78111 cmake --build tests\build-Ax86 --config release || exit /b %errorlevel%
79112 dir tests\build-Ax86\helloworld.exe
80113 tests\build-Ax86\helloworld.exe 1 2 3 4
0 commit comments