mirror of
https://github.com/nlohmann/json.git
synced 2025-01-20 00:03:02 +08:00
👷 move some MSVC jobs from AppVeyor to GitHub Actions
This commit is contained in:
parent
5213ae56ac
commit
c591b6ca6c
112
.github/workflows/windows.yml
vendored
112
.github/workflows/windows.yml
vendored
@ -3,17 +3,109 @@ name: Windows
|
|||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
mingw:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up MinGW
|
||||||
|
uses: egor-tensin/setup-mingw@v2
|
||||||
|
with:
|
||||||
|
platform: x64
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Debug --output-on-failure
|
||||||
|
|
||||||
|
mingw_win32:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up MinGW
|
||||||
|
uses: egor-tensin/setup-mingw@v2
|
||||||
|
with:
|
||||||
|
platform: x86
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Debug --output-on-failure
|
||||||
|
|
||||||
|
msvc2017:
|
||||||
|
runs-on: windows-2016
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -G "Visual Studio 15 2017" -DJSON_BuildTests=On
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --config Release --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Release --output-on-failure
|
||||||
|
|
||||||
|
msvc2017_latest:
|
||||||
|
runs-on: windows-2016
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -G "Visual Studio 15 2017" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8"
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --config Release --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Release --output-on-failure
|
||||||
|
|
||||||
|
msvc2017_win32:
|
||||||
|
runs-on: windows-2016
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -G "Visual Studio 15 2017" -A "Win32" -DJSON_BuildTests=On
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --config Release --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Release --output-on-failure
|
||||||
|
|
||||||
msvc2019:
|
msvc2019:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: cmake
|
- name: cmake
|
||||||
run: cmake -S . -B build -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
|
run: cmake -S . -B build -G "Visual Studio 16 2019" -DJSON_BuildTests=On
|
||||||
- name: build
|
- name: build
|
||||||
run: cmake --build build --parallel 10
|
run: cmake --build build --config Release --parallel 10
|
||||||
- name: test
|
- name: test
|
||||||
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
|
run: cd build ; ctest -j 10 -C Release --output-on-failure
|
||||||
|
|
||||||
|
msvc2019_latest:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -G "Visual Studio 16 2019" -DJSON_BuildTests=On -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8"
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --config Release --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Release --output-on-failure
|
||||||
|
|
||||||
|
msvc2019_win32:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -G "Visual Studio 16 2019" -A "Win32" -DJSON_BuildTests=On
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --config Release --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Release --output-on-failure
|
||||||
|
|
||||||
clang10:
|
clang10:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
@ -29,6 +121,20 @@ jobs:
|
|||||||
- name: test
|
- name: test
|
||||||
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
|
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
|
||||||
|
|
||||||
|
clang11:
|
||||||
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: install Clang
|
||||||
|
run: curl -fsSL -o LLVM11.exe https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/LLVM-11.0.0-win64.exe ; 7z x LLVM11.exe -y -o"C:/Program Files/LLVM"
|
||||||
|
- name: cmake
|
||||||
|
run: cmake -S . -B build -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
|
||||||
|
- name: build
|
||||||
|
run: cmake --build build --parallel 10
|
||||||
|
- name: test
|
||||||
|
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
|
||||||
|
|
||||||
clang-cl-10-x64:
|
clang-cl-10-x64:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|
||||||
|
33
appveyor.yml
33
appveyor.yml
@ -34,24 +34,6 @@ environment:
|
|||||||
CMAKE_OPTIONS: ""
|
CMAKE_OPTIONS: ""
|
||||||
GENERATOR: Visual Studio 16 2019
|
GENERATOR: Visual Studio 16 2019
|
||||||
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
||||||
configuration: Debug
|
|
||||||
COMPILER: mingw
|
|
||||||
platform: x86
|
|
||||||
CXX_FLAGS: ""
|
|
||||||
LINKER_FLAGS: ""
|
|
||||||
CMAKE_OPTIONS: ""
|
|
||||||
GENERATOR: Ninja
|
|
||||||
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
||||||
configuration: Release
|
|
||||||
COMPILER: mingw
|
|
||||||
platform: x86
|
|
||||||
CXX_FLAGS: ""
|
|
||||||
LINKER_FLAGS: ""
|
|
||||||
CMAKE_OPTIONS: ""
|
|
||||||
GENERATOR: Ninja
|
|
||||||
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
configuration: Release
|
configuration: Release
|
||||||
platform: x86
|
platform: x86
|
||||||
@ -85,14 +67,6 @@ environment:
|
|||||||
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
|
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
|
||||||
GENERATOR: Visual Studio 16 2019
|
GENERATOR: Visual Studio 16 2019
|
||||||
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
||||||
configuration: Release
|
|
||||||
platform: x64
|
|
||||||
CXX_FLAGS: ""
|
|
||||||
LINKER_FLAGS: ""
|
|
||||||
CMAKE_OPTIONS: ""
|
|
||||||
GENERATOR: Visual Studio 16 2019
|
|
||||||
|
|
||||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||||
configuration: Release
|
configuration: Release
|
||||||
platform: x64
|
platform: x64
|
||||||
@ -122,18 +96,13 @@ init:
|
|||||||
- msbuild /version
|
- msbuild /version
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if "%COMPILER%"=="mingw" appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip
|
|
||||||
- if "%COMPILER%"=="mingw" 7z x ninja.zip -oC:\projects\deps\ninja > nul
|
|
||||||
- if "%COMPILER%"=="mingw" set PATH=C:\projects\deps\ninja;%PATH%
|
|
||||||
- if "%COMPILER%"=="mingw" set PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
|
|
||||||
- if "%COMPILER%"=="mingw" g++ --version
|
|
||||||
- if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32
|
- if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32
|
||||||
|
|
||||||
before_build:
|
before_build:
|
||||||
# for with_win_header build, inject the inclusion of Windows.h to the single-header library
|
# for with_win_header build, inject the inclusion of Windows.h to the single-header library
|
||||||
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
|
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
|
||||||
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
|
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
|
||||||
- if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%") else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%")
|
- cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%"
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- cmake --build . --config "%configuration%"
|
- cmake --build . --config "%configuration%"
|
||||||
|
Loading…
Reference in New Issue
Block a user