diff --git a/.decent_ci-Linux.yaml b/.decent_ci-Linux.yaml deleted file mode 100644 index 2449f9e873f..00000000000 --- a/.decent_ci-Linux.yaml +++ /dev/null @@ -1,38 +0,0 @@ -compilers: - - name: "gcc" - version: "13.3" - cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DBUILD_PERFORMANCE_TESTS:BOOL=ON -DVALGRIND_ANALYZE_PERFORMANCE_TESTS:BOOL=ON -DENABLE_PCH:BOOL=OFF - collect_performance_results: true - skip_regression: true - s3_upload_bucket: energyplus - num_parallel_builds: 16 - - - name: "gcc" - version: "13.3" - build_type: RelWithDebInfo - cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_DEBUG_ARITHM_GCC_OR_CLANG:BOOL=ON - coverage_enabled: true - coverage_base_dir: src/EnergyPlus - coverage_pass_limit: 41.0 - coverage_warn_limit: 40.0 - coverage_s3_bucket: energyplus - build_tag: UnitTestsCoverage - ctest_filter: -E "integration.*" - skip_regression: true - skip_packaging: true - num_parallel_builds: 14 - - - name: "gcc" - version: "13.3" - build_type: RelWithDebInfo - cmake_extra_flags: -DLINK_WITH_PYTHON:BOOL=ON -DPYTHON_CLI:BOOL=OFF -DPython_REQUIRED_VERSION:STRING=3.12.2 -DPython_ROOT_DIR:PATH=~/.pyenv/versions/3.12.2/ -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DENABLE_REGRESSION_TESTING:BOOL=OFF -DCOMMIT_SHA:STRING=$COMMIT_SHA -DENABLE_COVERAGE:BOOL=ON -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DENABLE_PCH:BOOL=OFF -DFORCE_DEBUG_ARITHM_GCC_OR_CLANG:BOOL=ON - coverage_enabled: true - coverage_base_dir: src/EnergyPlus - coverage_pass_limit: 66.0 - coverage_warn_limit: 67.0 - coverage_s3_bucket: energyplus - build_tag: IntegrationCoverage - ctest_filter: -R "integration.*" - skip_regression: true - skip_packaging: true - num_parallel_builds: 14 diff --git a/.decent_ci-Windows.yaml b/.decent_ci-Windows.yaml deleted file mode 100644 index 0d6b529304d..00000000000 --- a/.decent_ci-Windows.yaml +++ /dev/null @@ -1,6 +0,0 @@ -compilers: - - name: Visual Studio - version: 16 - architecture: Win64 - cmake_extra_flags: -DBUILD_FORTRAN:BOOL=ON -DBUILD_TESTING:BOOL=ON -DCOMMIT_SHA=%COMMIT_SHA% -DENABLE_GTEST_DEBUG_MODE:BOOL=OFF -DLINK_WITH_PYTHON=ON -DPYTHON_CLI:BOOL=OFF -DPython_EXECUTABLE:PATH=C:/Users/elee/AppData/Local/Programs/Python/Python312/python.exe - skip_regression: true diff --git a/.decent_ci.yaml b/.decent_ci.yaml deleted file mode 100644 index a80d9aee629..00000000000 --- a/.decent_ci.yaml +++ /dev/null @@ -1,12 +0,0 @@ -results_repository : Myoldmopar/EnergyPlusBuildResults -results_path : _posts -results_base_url : https://myoldmopar.github.io/EnergyPlusBuildResults -regression_repository : NREL/EnergyPlusRegressionTool -regression_branch : main # this is the branch of NREL/EnergyPlusRegressionTool to use (usually main) -regression_baseline_default : develop # this is the NREL/EnergyPlus branch to use as the baseline for regressions -regression_baseline_develop : "" -regression_baseline_master : "" -notification_recipients: - - myoldmopar -aging_pull_requests_notification: true -aging_pull_requests_numdays: 28 diff --git a/.github/actions/configure-and-build/action.yml b/.github/actions/configure-and-build/action.yml index 45722c54865..5a23d11e785 100644 --- a/.github/actions/configure-and-build/action.yml +++ b/.github/actions/configure-and-build/action.yml @@ -17,6 +17,15 @@ inputs: enable-pch: description: "Turn on ENABLE_PCH to have pre-compiled headers. Pass ON or OFF" default: "OFF" + build-type: + description: "The CMake build type to use, which will default to release" + default: "Release" + enable-coverage: + description: "Turn this on to set the ENABLE_COVERAGE CMake variable to ON. Pass ON or OFF." + default: "OFF" + build-python-cli: + description: "Turn on the PYTHON_CLI build configuration. Pass ON or OFF." + default: "ON" runs: using: "composite" @@ -50,9 +59,10 @@ runs: cmake ` -G Ninja ` -DENABLE_PCH:BOOL=${{ inputs.enable-pch }} ` - -DCMAKE_BUILD_TYPE:STRING=Release ` + -DCMAKE_BUILD_TYPE:STRING=${{ inputs.build-type }} ` -DLINK_WITH_PYTHON:BOOL=ON ` - -DPYTHON_CLI:BOOL=ON ` + -DPYTHON_CLI:BOOL=${{ inputs.build-python-cli }} ` + -DENABLE_COVERAGE:BOOL=${{ inputs.enable-coverage }} ` -DPython_REQUIRED_VERSION:STRING=${{ inputs.python-version }} ` -DPython_ROOT_DIR:PATH=${{ inputs.python-root-dir }} ` -DBUILD_TESTING:BOOL=ON ` @@ -91,9 +101,10 @@ runs: cmake \ -G Ninja \ -DENABLE_PCH:BOOL=${{ inputs.enable-pch }} \ - -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_BUILD_TYPE:STRING=${{ inputs.build-type }} \ -DLINK_WITH_PYTHON:BOOL=ON \ - -DPYTHON_CLI:BOOL=ON \ + -DPYTHON_CLI:BOOL=${{ inputs.build-python-cli }} \ + -DENABLE_COVERAGE:BOOL=${{ inputs.enable-coverage }} \ -DPython_REQUIRED_VERSION:STRING=${{ inputs.python-version }} \ -DPython_ROOT_DIR:PATH=${{ inputs.python-root-dir }} \ -DBUILD_TESTING:BOOL=ON \ diff --git a/.github/workflows/test_pull_request_debug.yml b/.github/workflows/test_pull_request_debug.yml new file mode 100644 index 00000000000..35038762727 --- /dev/null +++ b/.github/workflows/test_pull_request_debug.yml @@ -0,0 +1,121 @@ +name: Debug Build and Test + +# run this on all commits to the develop branch +# once a large runner, or a self-hosted runner, is available, re-enable for all pull requests +on: + # pull_request: + # branches: [ develop ] + push: + branches: [ develop, AddRWDBuildToGHA ] + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FC: gfortran-13 + Python_REQUIRED_VERSION: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA + python-arch: x64 + os: ubuntu-24.04 + +jobs: + build_and_test: + name: Debug Testing + runs-on: ubuntu-24.04 + permissions: + pull-requests: write + + steps: + + - uses: actions/checkout@v5 + + - name: Setup System + id: setup-runner + uses: ./.github/actions/setup-runner + with: + python-version: ${{ env.Python_REQUIRED_VERSION }} + python-arch: ${{ env.python-arch }} + + - name: Install coverage tools + shell: bash + run: sudo apt-get update && sudo apt-get install lcov gcovr + + - name: Create Build Directory + shell: bash + run: cmake -E make_directory ./build/ + + - name: Install problem matcher + shell: bash + run: echo "::add-matcher::./.github/workflows/cpp-problem-matcher.json" + + - name: Configure and Build + id: branch_build + uses: ./.github/actions/configure-and-build + with: + enable-pch: ${{ env.ENABLE_PCH }} + minimal-targets: false + build-directory: ./build + nproc: ${{ steps.setup-runner.outputs.nproc }} + python-version: ${{ env.Python_REQUIRED_VERSION }} + python-root-dir: ${{ steps.setup-runner.outputs.python-root-dir }} + build-type: "RelWithDebInfo" + enable-coverage: "ON" + build-python-cli: "OFF" + + - name: Remove problem matcher + shell: bash + run: echo "::remove-matcher owner=gcc-problem-matcher::" + + - name: Run Tests + working-directory: ./build + shell: bash + run: | + begin_group() { echo -e "::group::\033[93m$1\033[0m"; } + + Color_Off='\033[0m' # Text Reset + + # Regular Colors + Red='\033[0;31m' + Green='\033[0;32m' + + begin_group "Running CTests" + if ctest -j ${{ env.NPROC }} -E "integration\.HospitalLowEnergy|integration\.DirectIndirectEvapCoolersVSAS|integration\.HospitalBaselineReheatReportEMS|integration\.HospitalBaseline|integration\.ASHRAE901_ApartmentHighRise_STD2019_Denver|integration\.RefBldgOutPatientNew2004_Chicago|integration\.UnitarySystem_MultiSpeedDX_EconoStaging|integration\.ASHRAE901_OutPatientHealthCare_STD2019_Denver|integration\.UnitaryHybridAC_DedicatedOutsideAir|integration\.RefrigeratedWarehouse|integration\.RefBldgSecondarySchoolNew2004_Chicago|integration\.LgOffVAVusingBasement|integration\.EcoroofOrlando|integration\._5ZoneAirCooled_LeapYear_annual|integration\.EcoroofOrlando_NoSitePrec|integration\._5ZoneAirCooled_annual"; then + echo "::endgroup::" + echo -e "✅ ${Green}All tests passed${Color_Off}" + else + echo "::endgroup::" + echo -e "❌ ${Red}Some Tests Failed${Color_Off}" + begin_group "Re-running failed tests verbosely..." + ctest --rerun-failed -VV + echo "::endgroup::" + fi; + + # I fully acknowledge that there is a better way to get coverage results + # I tried running some of the tips from Julien, but could not get them to work fully + # The series of steps here are hacky, but pretty much works, so I'm leaving it. + # When the next person gets here to clean this up, don't forget to add a message to the GITHUB_STEP_SUMMARY + # And even better would be to post a message as a PR comment like we do for regressions. + + - name: Prepare Initial Coverage Results + shell: bash + working-directory: ./build + run: lcov -c -d . -o lcov.raw.info --base-directory ../src/EnergyPlus --ignore-errors source,mismatch + + - name: Why does it have src/src/? I don't know, but remove it! + shell: bash + working-directory: ./build + run: sed -i 's#/src/src/#/src/#g' lcov.raw.info + + - name: Clean up Coverage Results + shell: bash + working-directory: ./build + run: lcov -e lcov.raw.info "*/EnergyPlus/src/EnergyPlus/*" -o lcov.filtered.info + # could also run lcov -r to remove some of the generated files, like the embedded schema cc file + + - name: Generate HTML Coverage Package + shell: bash + working-directory: ./build + run: genhtml lcov.filtered.info -o lcov-html --title "EnergyPlus Coverage" --synthesize-missing --ignore-errors source + + - name: Upload folder as artifact + uses: actions/upload-artifact@v4 + with: + name: coverage-results + path: ./build/lcov-html