From 50e9a66295039e539bcb86e5b1982672c6f83e42 Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Sun, 10 Nov 2024 13:12:15 -0800 Subject: [PATCH] Build for both Release and Debug modes --- .github/workflows/ci_macos.yml | 5 +++ .github/workflows/ci_ubuntu.yml | 8 ++++ .github/workflows/ci_windows.yml | 8 ++++ pixi.toml | 66 ++++++++++++++++---------------- 4 files changed, 54 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci_macos.yml b/.github/workflows/ci_macos.yml index 0a72e9f2e397f..d51da44c5fd07 100644 --- a/.github/workflows/ci_macos.yml +++ b/.github/workflows/ci_macos.yml @@ -28,6 +28,7 @@ jobs: fail-fast: false matrix: os: [macos-latest] + build_mode: ["Release", "Debug"] steps: - name: Checkout uses: actions/checkout@v4 @@ -42,8 +43,12 @@ jobs: - name: Test DART and dartpy run: | + VERBOSE=ON \ + BUILD_TYPE=${{ matrix.build_mode }} \ pixi run test-all - name: Install run: | + VERBOSE=ON \ + BUILD_TYPE=${{ matrix.build_mode }} \ pixi run install diff --git a/.github/workflows/ci_ubuntu.yml b/.github/workflows/ci_ubuntu.yml index 4e33ba56fc922..449ceb3112a83 100644 --- a/.github/workflows/ci_ubuntu.yml +++ b/.github/workflows/ci_ubuntu.yml @@ -75,6 +75,10 @@ jobs: build: name: ubuntu runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + build_mode: ["Release", "Debug"] steps: - name: Checkout uses: actions/checkout@v4 @@ -94,8 +98,12 @@ jobs: - name: Test DART and dartpy run: | + VERBOSE=ON \ + BUILD_TYPE=${{ matrix.build_mode }} \ pixi run test-all - name: Install run: | + VERBOSE=ON \ + BUILD_TYPE=${{ matrix.build_mode }} \ pixi run install diff --git a/.github/workflows/ci_windows.yml b/.github/workflows/ci_windows.yml index 129fc782dbc20..02aae06186987 100644 --- a/.github/workflows/ci_windows.yml +++ b/.github/workflows/ci_windows.yml @@ -24,6 +24,10 @@ jobs: build: name: win runs-on: windows-latest + strategy: + fail-fast: false + matrix: + build_mode: ["Release", "Debug"] steps: - name: Checkout uses: actions/checkout@v4 @@ -38,8 +42,12 @@ jobs: - name: Test DART and dartpy run: | + VERBOSE=ON \ + BUILD_TYPE=${{ matrix.build_mode }} \ pixi run test-all - name: Install run: | + VERBOSE=ON \ + BUILD_TYPE=${{ matrix.build_mode }} \ pixi run install diff --git a/pixi.toml b/pixi.toml index 7e1707aa6f0c6..955ddc235a7df 100644 --- a/pixi.toml +++ b/pixi.toml @@ -53,14 +53,14 @@ config = { cmd = """ -S . \ -B build \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - -DCMAKE_BUILD_TYPE=Release \ - -DDART_VERBOSE=$DART_VERBOSE \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DDART_VERBOSE=$VERBOSE \ -DDART_USE_SYSTEM_IMGUI=ON \ -DCMAKE_PREFIX_PATH=$CONDA_PREFIX \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ -DCMAKE_INSTALL_RPATH=$CONDA_PREFIX/lib \ -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON -""", env = { DART_VERBOSE = "ON" } } +""", env = { VERBOSE = "OFF", BUILD_TYPE = "Release" } } lint-cpp = { cmd = "cmake --build build --target format", depends_on = [ "config", @@ -196,11 +196,11 @@ config = { cmd = """ -B build \ -G 'Visual Studio 17 2022' \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ - -DDART_VERBOSE=ON \ + -DDART_VERBOSE=$DART_VERBOSE \ -DDART_MSVC_DEFAULT_OPTIONS=ON \ -DBUILD_SHARED_LIBS=OFF \ -DDART_USE_SYSTEM_IMGUI=ON -""" } +""", env = { DART_VERBOSE = "OFF" } } lint-py = { cmd = "black . --exclude '\\..*' && isort . --skip-glob '.*'", depends_on = [ "config", ] } @@ -210,51 +210,51 @@ check-lint-py = { cmd = "black . --check --exclude '\\..*' && isort . --check -- ] } check-lint = { depends_on = ["check-lint-py"] } -build = { cmd = "cmake --build build --config Release -j", depends_on = [ +build = { cmd = "cmake --build build --config $BUILD_TYPE -j", depends_on = [ "config", -] } -build-tests = { cmd = "cmake --build build --config Release -j --target tests", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +build-tests = { cmd = "cmake --build build --config $BUILD_TYPE -j --target tests", depends_on = [ "config", -] } +], env = { BUILD_TYPE = "OFF" } } build-dartpy = { cmd = "cmake --build build -j --target dartpy", depends_on = [ "config", ] } -test = { cmd = "ctest --test-dir build --build-config Release --output-on-failure", depends_on = [ +test = { cmd = "ctest --test-dir build --build-config $BUILD_TYPE --output-on-failure", depends_on = [ "build-tests", -] } -test-dartpy = { cmd = "cmake --build build --config Release -j --target pytest", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +test-dartpy = { cmd = "cmake --build build --config $BUILD_TYPE -j --target pytest", depends_on = [ "config", -] } -test-all = { cmd = "cmake --build build --config Release -j --target ALL", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +test-all = { cmd = "cmake --build build --config $BUILD_TYPE -j --target ALL", depends_on = [ "config", -] } +], env = { BUILD_TYPE = "OFF" } } -tu-biped = { cmd = "cmake --build build --config Release --target tutorial_biped --parallel && build/Release/tutorial_biped.exe", depends_on = [ +tu-biped = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_biped --parallel && build/$BUILD_TYPE/tutorial_biped.exe", depends_on = [ "config", -] } -tu-biped-fi = { cmd = "cmake --build build --config Release --target tutorial_biped_finished --parallel && build/Release/tutorial_biped_finished.exe", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +tu-biped-fi = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_biped_finished --parallel && build/$BUILD_TYPE/tutorial_biped_finished.exe", depends_on = [ "config", -] } -tu-collisions = { cmd = "cmake --build build --config Release --target tutorial_collisions --parallel && build/Release/tutorial_collisions.exe", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +tu-collisions = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_collisions --parallel && build/$BUILD_TYPE/tutorial_collisions.exe", depends_on = [ "config", -] } -tu-collisions-fi = { cmd = "cmake --build build --config Release --target tutorial_collisions_finished --parallel && build/Release/tutorial_collisions_finished.exe", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +tu-collisions-fi = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_collisions_finished --parallel && build/$BUILD_TYPE/tutorial_collisions_finished.exe", depends_on = [ "config", -] } -tu-dominoes = { cmd = "cmake --build build --config Release --target tutorial_dominoes --parallel && build/Release/tutorial_dominoes.exe", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +tu-dominoes = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_dominoes --parallel && build/$BUILD_TYPE/tutorial_dominoes.exe", depends_on = [ "config", -] } -tu-dominoes-fi = { cmd = "cmake --build build --config Release --target tutorial_dominoes_finished --parallel && build/Release/tutorial_dominoes_finished.exe", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +tu-dominoes-fi = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_dominoes_finished --parallel && build/$BUILD_TYPE/tutorial_dominoes_finished.exe", depends_on = [ "config", -] } -tu-multi-pendulum = { cmd = "cmake --build build --config Release --target tutorial_multi_pendulum --parallel && build/Release/tutorial_multi_pendulum.exe", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +tu-multi-pendulum = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_multi_pendulum --parallel && build/$BUILD_TYPE/tutorial_multi_pendulum.exe", depends_on = [ "config", -] } -tu-multi-pendulum-fi = { cmd = "cmake --build build --config Release --target tutorial_multi_pendulum_finished --parallel && build/Release/tutorial_multi_pendulum_finished.exe", depends_on = [ +], env = { BUILD_TYPE = "OFF" } } +tu-multi-pendulum-fi = { cmd = "cmake --build build --config $BUILD_TYPE --target tutorial_multi_pendulum_finished --parallel && build/$BUILD_TYPE/tutorial_multi_pendulum_finished.exe", depends_on = [ "config", -] } +], env = { BUILD_TYPE = "OFF" } } -install = { cmd = "cmake --build build --config Release -j --target install", depends_on = [ +install = { cmd = "cmake --build build --config $BUILD_TYPE -j --target install", depends_on = [ "build", -] } +], env = { BUILD_TYPE = "OFF" } }