diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c4e27e3..cb082a4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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: @@ -54,15 +56,15 @@ 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/ccache-action@v1.2.12 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 @@ -70,13 +72,14 @@ 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 \ - -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: | @@ -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 @@ -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 @@ -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: | @@ -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 @@ -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 \ @@ -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: @@ -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/ccache-action@v1.2.12 with: @@ -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