Skip to content

Run tests in GitHub actions #227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
1a7d0e4
Update linux_build.yaml
kohnech Mar 11, 2024
6ac5ddc
Update linux_build.yaml
kohnech Mar 11, 2024
cc568c0
Make action more readable. Configure with tests enabled.
kohnech Mar 11, 2024
995c44c
Save OREData tests as artifacts
kohnech Mar 11, 2024
f1c3e20
Debug build output
kohnech Mar 11, 2024
19ebcb3
Switch workspace variable
kohnech Mar 11, 2024
090287f
Testing compatible version for download artifact
kohnech Mar 11, 2024
ebc56f1
Uploading the remaining test artifacts
kohnech Mar 11, 2024
289ba96
Debug testing section
kohnech Mar 12, 2024
21a9ef6
Rename upload name
kohnech Mar 12, 2024
86a0c5d
Fix suite path
kohnech Mar 12, 2024
44cbfd9
Try fix permission denied
kohnech Mar 12, 2024
65be4f7
Update commonSettings.cmake
kohnech Dec 5, 2023
8a60ac7
Use boost release
kohnech Dec 5, 2023
b94d897
Update commonSettings.cmake
kohnech Dec 5, 2023
2d8da8a
Update commonSettings.cmkae
kohnech Dec 5, 2023
5e88f43
Update commonSettings.cmake
kohnech Dec 5, 2023
ad3abf1
Update commonSettings.cmake
kohnech Dec 5, 2023
d1b2a23
Update commonSettings.cmake
kohnech Jan 2, 2024
234a6d9
Must link boost statically
kohnech Mar 12, 2024
0f11396
Change base data path
kohnech Mar 12, 2024
f0bb8fd
Test check path
kohnech Mar 12, 2024
ab597e7
Improve readability
kohnech Mar 12, 2024
43b4007
Update to v4
kohnech Mar 12, 2024
8823a13
Correcting base data path
kohnech Mar 12, 2024
ce58d00
Cleanup and use relative path instead
kohnech Mar 12, 2024
adc4942
Fix review comment, cleanup
kohnech Mar 12, 2024
a2a5389
Add remaining test suites
kohnech Mar 12, 2024
578ad5f
Remove duplicate configuration
kohnech Mar 13, 2024
00afae1
Make windows workflow more readable
kohnech Mar 13, 2024
e65ca7d
Separate windows workflow into configure and build
kohnech Mar 13, 2024
a5fe0b4
Fix powershell multiline
kohnech Mar 13, 2024
b17edbc
Cannot use multiline in cmd
kohnech Mar 13, 2024
ca6a154
Need sdk loaded
kohnech Mar 13, 2024
26efdd1
Use 4 cores in windows
kohnech Mar 13, 2024
230bf3d
Fix powershell command
kohnech Mar 13, 2024
580c30b
Run tests
kohnech Mar 13, 2024
e7a6674
Fix upload path
kohnech Mar 13, 2024
deaabff
Fix path mistake for download artifact
kohnech Mar 13, 2024
f52e1ef
Need .exe file ending on windows
kohnech Mar 13, 2024
8270991
Only run tests for x64 and upload test artifacts
kohnech Mar 13, 2024
017d1c2
Cleanup debug
kohnech Mar 16, 2024
32621a6
Merge branch 'master' of https://github.com/Model-Validation/Engine i…
kohnech Apr 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions .github/workflows/build_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,41 @@ jobs:
cd build
SET ZLIB_ROOT=C:\local\zlib-1.3.1
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Vc\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch }} -vcvars_ver=14.3 || exit 1
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DQL_BUILD_EXAMPLES=false -DQL_BUILD_TEST_SUITE=false -DQL_BUILD_BENCHMARK=false -DQL_ENABLE_SESSIONS=true -DORE_USE_ZLIB=ON -DORE_BUILD_DOC=false -DBOOST_INCLUDEDIR=C:\local\boost -DZLIB_LIBRARY=C:\local\zlib-1.3.1\build\Release\zlib.lib -DBOOST_LIBRARYDIR=C:\local\boost\lib64-msvc-14.3 -L
cmake --build . -j 2 --verbose
cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DQL_BUILD_EXAMPLES=false -DQL_BUILD_TEST_SUITE=false -DQL_BUILD_BENCHMARK=false -DQL_ENABLE_SESSIONS=true -DORE_USE_ZLIB=ON -DORE_BUILD_DOC=false -DORE_BUILD_EXAMPLES=false -DORE_BUILD_APP=true -DORE_BUILD_TESTS=true -DBOOST_INCLUDEDIR=C:\local\boost -DZLIB_LIBRARY=C:\local\zlib-1.3.1\build\Release\zlib.lib -DBOOST_LIBRARYDIR=C:\local\boost\lib64-msvc-14.3 -L
cmake --build . -j 4 --verbose
- name: Save tests artifacts
uses: actions/upload-artifact@v4
if: ${{ matrix.arch == 'AMD64' }}
with:
name: test-suites
path: |
${{ github.workspace }}\build\OREData\test\ored-test-suite.exe
${{ github.workspace }}\build\OREAnalytics\test\orea-test-suite.exe
${{ github.workspace }}\build\QuantExt\test\quantext-test-suite.exe
- name: Save executables as artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3
with:
name: ore-windows-${{ matrix.arch }}
path: D:\a\Engine\Engine\build\App\ore.exe
path: ${{ github.workspace }}\build\App\ore.exe

tests:
name: testing
runs-on: windows-2022
needs: build
steps:
- uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: test-suites
path: ${{ github.workspace }}\test-suites
- name: run QuantExt tests
run: |
.\test-suites\QuantExt\test\quantext-test-suite.exe
- name: run OREData tests
run: |
.\test-suites\OREData\test\ored-test-suite.exe -- --base_data_path=.\OREData\test
- name: run OREAnalytics tests
run: |
.\test-suites\OREAnalytics\test\orea-test-suite.exe
54 changes: 51 additions & 3 deletions .github/workflows/linux_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,60 @@ jobs:
sudo apt update
sudo apt install -y libboost-all-dev libboost-test-dev ninja-build
- name: cmake configure
run : mkdir build; cd build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=false -DQL_BUILD_EXAMPLES=false -DQL_BUILD_TEST_SUITE=false -DQL_BUILD_BENCHMARK=false -DQL_ENABLE_SESSIONS=true -DORE_BUILD_DOC=false -G "Ninja" ..
run : |
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=false \
-DQL_BUILD_EXAMPLES=false \
-DQL_BUILD_TEST_SUITE=false \
-DQL_BUILD_BENCHMARK=false \
-DQL_ENABLE_SESSIONS=true \
-DORE_BUILD_DOC=false \
-DORE_BUILD_EXAMPLES=false \
-DORE_BUILD_APP=true \
-DORE_BUILD_TESTS=true \
-L
- name: cmake build
run: cd build/; pwd; cmake --build . -j $(nproc)
run: |
cd build
cmake --build . -j $(nproc)
- name: Save tests artifacts
uses: actions/upload-artifact@v4
with:
name: test-suites
path: |
${{ github.workspace }}/build/OREData/test/ored-test-suite
${{ github.workspace }}/build/OREAnalytics/test/orea-test-suite
${{ github.workspace }}/build/QuantExt/test/quantext-test-suite
- name: Save executables as artifacts
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v3
with:
name: ore-exe-linux
path: /home/runner/work/Engine/Engine/build/App/ore
path: ${{ github.workspace }}/build/App/ore

# Run tests
tests:
name: testing
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: test-suites
path: ${{ github.workspace }}/test-suites
- name: run QuantExt tests
run: |
chmod +x ./test-suites/QuantExt/test/quantext-test-suite
./test-suites/QuantExt/test/quantext-test-suite
- name: run OREData tests
run: |
chmod +x ./test-suites/OREData/test/ored-test-suite
./test-suites/OREData/test/ored-test-suite -- --base_data_path=./OREData/test
- name: run OREAnalytics tests
run: |
chmod +x ./test-suites/OREAnalytics/test/orea-test-suite
./test-suites/OREAnalytics/test/orea-test-suite
66 changes: 38 additions & 28 deletions cmake/commonSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,6 @@ if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY
"MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${MSVC_LINK_DYNAMIC_RUNTIME}>:DLL>")

# link against static boost libraries
if(NOT DEFINED Boost_USE_STATIC_LIBS)
if(BUILD_SHARED_LIBS)
set(Boost_USE_STATIC_LIBS 0)
else()
set(Boost_USE_STATIC_LIBS 1)
endif()
endif()

# Boost static runtime ON for MSVC
if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
if(BUILD_SHARED_LIBS OR(MSVC AND MSVC_LINK_DYNAMIC_RUNTIME))
set(Boost_USE_STATIC_RUNTIME 0)
else()
set(Boost_USE_STATIC_RUNTIME 1)
endif()
endif()



IF(NOT Boost_USE_STATIC_LIBS)
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-DBOOST_TEST_DYN_LINK)
endif()
add_compile_options(/external:env:BOOST)
add_compile_options(/external:W0)
add_compile_definitions(_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING)
Expand Down Expand Up @@ -137,9 +113,8 @@ else()
set(BUILD_SHARED_LIBS ON)
endif()

# link against dynamic boost libraries
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-DBOOST_TEST_DYN_LINK)
# Issue with Boost CMake finder introduced in version 1.70
set(Boost_NO_BOOST_CMAKE ON)

# avoid a crash in valgrind that sometimes occurs if this flag is not defined
add_definitions(-DBOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
Expand Down Expand Up @@ -196,9 +171,44 @@ else()
# if QuantLib is build separately
include_directories("${CMAKE_CURRENT_LIST_DIR}/../QuantLib/build")


endif()

# Boost #
# link against static boost libraries
if(NOT DEFINED Boost_USE_STATIC_LIBS)
if(BUILD_SHARED_LIBS)
set(Boost_USE_STATIC_LIBS OFF)
else()
set(Boost_USE_STATIC_LIBS ON)
endif()
endif()

# Boost static runtime. ON for MSVC
if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
if(BUILD_SHARED_LIBS OR(MSVC AND MSVC_LINK_DYNAMIC_RUNTIME))
set(Boost_USE_STATIC_RUNTIME OFF)
else()
set(Boost_USE_STATIC_RUNTIME ON)
endif()
endif()

if(NOT Boost_USE_STATIC_LIBS)
# link against dynamic boost libraries
add_definitions(-DBOOST_ALL_DYN_LINK)
add_definitions(-DBOOST_TEST_DYN_LINK)
endif()

# Use Boost Release/Debug
if(CMAKE_BUILD_TYPE MATCHES Release)
set(Boost_USE_DEBUG_LIBS OFF)
set(Boost_USE_RELEASE_LIBS ON)
elseif(CMAKE_BUILD_TYPE MATCHES Debug)
set(Boost_USE_DEBUG_LIBS ON)
set(Boost_USE_RELEASE_LIBS OFF)
endif()

# Boost end #

# workaround when building with boost 1.81, see https://github.com/boostorg/phoenix/issues/111
add_definitions(-DBOOST_PHOENIX_STL_TUPLE_H_)

Expand Down