@@ -37,69 +37,48 @@ jobs:
3737 - name : Test
3838 run : cd build ; ctest -j 10 -C Debug --output-on-failure
3939
40- msvc2019 :
41- runs-on : windows-2019
40+ msvc :
4241 strategy :
4342 matrix :
43+ runs_on : [windows-2019, windows-2022]
4444 build_type : [Debug, Release]
4545 architecture : [Win32, x64]
46+ std_version : [default, latest]
4647
47- steps :
48- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
49- - name : Run CMake
50- run : cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/W4 /WX"
51- if : matrix.build_type == 'Release'
52- - name : Run CMake
53- run : cmake -S . -B build -G "Visual Studio 16 2019" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON -DCMAKE_CXX_FLAGS="/W4 /WX"
54- if : matrix.build_type == 'Debug'
55- - name : Build
56- run : cmake --build build --config ${{ matrix.build_type }} --parallel 10
57- - name : Test
58- run : cd build ; ctest -j 10 -C ${{ matrix.build_type }} --output-on-failure
59-
60- msvc2019_latest :
61- runs-on : windows-2019
48+ runs-on : ${{ matrix.runs_on }}
6249
6350 steps :
64- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65- - name : Run CMake
66- run : cmake -S . -B build -G "Visual Studio 16 2019" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4 /WX"
67- - name : Build
68- run : cmake --build build --config Release --parallel 10
69- - name : Test
70- run : cd build ; ctest -j 10 -C Release --output-on-failure
71-
72- msvc2022 :
73- runs-on : windows-2022
74- strategy :
75- matrix :
76- build_type : [Debug, Release]
77- architecture : [Win32, x64]
78-
79- steps :
80- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
81- - name : Run CMake
82- run : cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/W4 /WX"
83- if : matrix.build_type == 'Release'
84- - name : Run CMake
85- run : cmake -S . -B build -G "Visual Studio 17 2022" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON -DCMAKE_CXX_FLAGS="/W4 /WX"
86- if : matrix.build_type == 'Debug'
87- - name : Build
88- run : cmake --build build --config ${{ matrix.build_type }} --parallel 10
89- - name : Test
90- run : cd build ; ctest -j 10 -C ${{ matrix.build_type }} --output-on-failure
91-
92- msvc2022_latest :
93- runs-on : windows-2022
94-
95- steps :
96- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
97- - name : Run CMake
98- run : cmake -S . -B build -G "Visual Studio 17 2022" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4 /WX"
99- - name : Build
100- run : cmake --build build --config Release --parallel 10
101- - name : Test
102- run : cd build ; ctest -j 10 -C Release --output-on-failure
51+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
52+ - name : Set generator
53+ id : generator
54+ run : |
55+ if [ "${{ matrix.runs_on }}" = "windows-2019" ]; then
56+ echo "generator=Visual Studio 16 2019" >> $GITHUB_ENV
57+ else
58+ echo "generator=Visual Studio 17 2022" >> $GITHUB_ENV
59+ fi
60+ shell : bash
61+ - name : Set extra CXX_FLAGS for latest std_version
62+ id : cxxflags
63+ run : |
64+ if [ "${{ matrix.std_version }}" = "latest" ]; then
65+ echo "flags=/permissive- /std:c++latest /utf-8 /W4 /WX" >> $GITHUB_ENV
66+ else
67+ echo "flags=/W4 /WX" >> $GITHUB_ENV
68+ fi
69+ shell : bash
70+ - name : Run CMake (Release)
71+ run : cmake -S . -B build -G "$env:generator" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="$env:flags"
72+ if : matrix.build_type == 'Release'
73+ shell : pwsh
74+ - name : Run CMake (Debug)
75+ run : cmake -S . -B build -G "$env:generator" -A ${{ matrix.architecture }} -DJSON_BuildTests=On -DJSON_FastTests=ON -DCMAKE_CXX_FLAGS="$env:flags"
76+ if : matrix.build_type == 'Debug'
77+ shell : pwsh
78+ - name : Build
79+ run : cmake --build build --config ${{ matrix.build_type }} --parallel 10
80+ - name : Test
81+ run : cd build ; ctest -j 10 -C ${{ matrix.build_type }} --output-on-failure
10382
10483 clang :
10584 runs-on : windows-2019
11897 - name : Test
11998 run : cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
12099
121- clang-cl-11 :
100+ clang-cl-12 :
122101 runs-on : windows-2019
123102 strategy :
124103 matrix :
0 commit comments