Skip to content

Commit

Permalink
Various CI fixes (#23)
Browse files Browse the repository at this point in the history
Adds C++20 builds to the Linux and Mac pipelines and uses QuantLib's build container everywhere. 

* removed cxx20 windows build due to failure
  • Loading branch information
raneamri authored Sep 18, 2024
1 parent 10fd9e2 commit 69aa4ad
Showing 1 changed file with 35 additions and 11 deletions.
46 changes: 35 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
fail-fast: false
matrix:
disable_aad: ["ON", "OFF"]
cxx: ["17", "20"]
runs-on: ubuntu-latest
container: ghcr.io/lballabio/quantlib-devenv:rolling
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -54,29 +56,30 @@ jobs:
- uses: actions/checkout@v4
with:
path: QuantLib-Risks-Cpp
- name: Setup
run: |
sudo apt update
sudo apt install -y libboost-dev ccache ninja-build
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: linux-${{ matrix.disable_aad }}
max-size: 650M
- name: Setup
run: |
apt-get update \
&& apt install -y ccache ninja-build
- name: Configure
run: |
rm -rf ${{ github.workspace }}/install
cd QuantLib
mkdir build
cd build
cmake -G Ninja -DBOOST_ROOT=/usr \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx }} \
-DQLRISKS_DISABLE_AAD=${{ matrix.disable_aad }} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DQL_EXTERNAL_SUBDIRECTORIES="${{ github.workspace }}/xad;${{ github.workspace }}/QuantLib-Risks-Cpp" \
-DQL_EXTERNAL_SUBDIRECTORIES="$(pwd)/../../xad;$(pwd)/../../QuantLib-Risks-Cpp" \
-DQL_EXTRA_LINK_LIBRARIES=QuantLib-Risks \
-DQL_NULL_AS_FUNCTIONS=ON \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install \
-DCMAKE_INSTALL_PREFIX=$(pwd)/../../install \
..
- name: Compile
run: |
Expand Down Expand Up @@ -112,7 +115,7 @@ jobs:
cd build
cmake -G Ninja -DBOOST_ROOT=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/install \
-DCMAKE_PREFIX_PATH=$(pwd)/../../install \
..
cmake --build .
./AdjointSwapXAD
Expand All @@ -125,6 +128,7 @@ jobs:
fail-fast: false
matrix:
disable_aad: ["ON", "OFF"]
cxx: ["17"]
runs-on: windows-2022
env:
vsvarsall: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
Expand Down Expand Up @@ -163,7 +167,15 @@ jobs:
mkdir build
cd build
call "${{ env.vsvarsall }}" amd64
cmake .. -G Ninja -DQLRISKS_DISABLE_AAD=${{ matrix.disable_aad }} -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DQL_EXTERNAL_SUBDIRECTORIES="${{ github.workspace }}/xad;${{ github.workspace }}/QuantLib-Risks-Cpp" -DQL_EXTRA_LINK_LIBRARIES=QuantLib-Risks -DQL_NULL_AS_FUNCTIONS=ON -DXAD_STATIC_MSVC_RUNTIME=ON -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
cmake .. -G Ninja -DQLRISKS_DISABLE_AAD=${{ matrix.disable_aad }} ^
-DCMAKE_CXX_STANDARD=${{ matrix.cxx }} ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DCMAKE_BUILD_TYPE=Release ^
-DQL_EXTERNAL_SUBDIRECTORIES="${{ github.workspace }}/xad;${{ github.workspace }}/QuantLib-Risks-Cpp" ^
-DQL_EXTRA_LINK_LIBRARIES=QuantLib-Risks ^
-DQL_NULL_AS_FUNCTIONS=ON ^
-DXAD_STATIC_MSVC_RUNTIME=ON ^
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install
- name: Build
shell: cmd
run: |
Expand Down Expand Up @@ -217,6 +229,7 @@ jobs:
fail-fast: false
matrix:
disable_aad: ["ON", "OFF"]
cxx: ["17", "20"]
runs-on: macos-13
env:
CXXFLAGS: -stdlib=libc++ -mmacosx-version-min=10.9
Expand Down Expand Up @@ -250,6 +263,7 @@ jobs:
mkdir build
cd build
cmake -G Ninja -DBOOST_ROOT=/usr \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx }} \
-DQLRISKS_DISABLE_AAD=${{ matrix.disable_aad }} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
Expand Down Expand Up @@ -298,7 +312,10 @@ jobs:
./AdjointSwapXAD
xad-linux-std-classes:
strategy:
fail-fast: false
runs-on: ubuntu-latest
container: ghcr.io/lballabio/quantlib-devenv:rolling
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -315,8 +332,8 @@ jobs:
path: QuantLib-Risks-Cpp
- name: Setup
run: |
sudo apt update
sudo apt install -y libboost-dev ccache ninja-build
apt-get update \
&& apt install -y ccache ninja-build \
- name: ccache
uses: hendrikmuhs/[email protected]
with:
Expand All @@ -327,7 +344,14 @@ jobs:
cd QuantLib
mkdir build
cd build
cmake -G Ninja -DBOOST_ROOT=/usr -DQL_USE_STD_CLASSES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQL_EXTERNAL_SUBDIRECTORIES="${{ github.workspace }}/xad;${{ github.workspace }}/QuantLib-Risks-Cpp" -DQL_EXTRA_LINK_LIBRARIES=QuantLib-Risks -DQL_NULL_AS_FUNCTIONS=ON ..
cmake -G Ninja -DBOOST_ROOT=/usr \
-DQL_USE_STD_CLASSES=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DQL_EXTERNAL_SUBDIRECTORIES="$(pwd)/../../xad;$(pwd)/../../QuantLib-Risks-Cpp" \
-DQL_EXTRA_LINK_LIBRARIES=QuantLib-Risks \
-DQL_NULL_AS_FUNCTIONS=ON \
..
- name: Compile
run: |
cd QuantLib/build
Expand Down

0 comments on commit 69aa4ad

Please sign in to comment.