diff --git a/.github/workflows/_build_and_package.yml b/.github/workflows/_build_and_package.yml index 7647b94920..edb4f57e53 100644 --- a/.github/workflows/_build_and_package.yml +++ b/.github/workflows/_build_and_package.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ "${{ inputs.osxRunner }}", windows-2022 ] + os: [ windows-2022 ] runs-on: ${{ matrix.os }} steps: - name: 'Download Source Tarfiles' @@ -58,29 +58,3 @@ jobs: conanHash: ${{ inputs.conanHash }} osxTargetDeploymentVersion: ${{ inputs.osxTargetDeploymentVersion }} - BuildLinux: - strategy: - fail-fast: false - matrix: - target: [ dissolve, dissolve-gui ] - runs-on: ubuntu-latest - steps: - - name: 'Download Source Tarfiles' - uses: actions/download-artifact@v4 - with: - name: source - - - name: 'Unpack Source' - shell: bash - run: tar -xvf dissolve-versioned-source.tar - - - name: "Build, Test, Package (Linux, ${{ matrix.target }})" - uses: "./.github/workflows/build" - with: - target: ${{ matrix.target }} - currentVersion: ${{ inputs.currentVersion }} - nixHash: ${{ inputs.nixHash }} - benchmark: ${{ inputs.benchmark }} - publishBenchmarks: ${{ inputs.publishBenchmarks }} - osxTargetDeploymentVersion: ${{ inputs.osxTargetDeploymentVersion }} - diff --git a/.github/workflows/build/osx/action.yml b/.github/workflows/build/osx/action.yml index 78e23117b4..1f1d312a41 100644 --- a/.github/workflows/build/osx/action.yml +++ b/.github/workflows/build/osx/action.yml @@ -181,18 +181,25 @@ runs: conan install . --deployer=direct_deploy --build=missing mkdir -p build && cd build - - cmake -G Ninja -DGUI:bool=true -DMULTI_THREADING:bool=${{ inputs.threading }} -DCONAN_GSL="OFF" -DJava_JAVA_EXECUTABLE:path=${JAVA_RUNTIME} -DANTLR_EXECUTABLE:string=$ANTLR_EXE -DQT_BASE_DIR=$QT_BASE_DIR ../ -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ inputs.osxTargetDeploymentVersion }} + cmake -G Ninja -DGUI:bool=true -DMULTI_THREADING:bool=${{ inputs.threading }} -DCONAN_GSL="OFF" -DJava_JAVA_EXECUTABLE:path=${JAVA_RUNTIME} -DANTLR_EXECUTABLE:string=$ANTLR_EXE -DQT_BASE_DIR=$QT_BASE_DIR ../ -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ inputs.osxTargetDeploymentVersion }} -DBUILD_TESTS:bool=ON cmake --build . --config Release # Move conan-installed deps to the build dir mv ../direct_deploy ./ - ls -R direct_deploy # Copy over gsl libs so we can ship them with the bundle. Our exe is only linked to two of the four libs present, and this breaks the binary if we don't include them all in the package. mkdir gsl cp -v $(brew --prefix gsl)/lib/*.dylib ./gsl + - name: Test + if: ${{ inputs.cacheOnly == 'false' }} + shell: bash + run: | + set -ex + cd build + + ctest --output-on-failure + - name: Upload Raw Build Artifacts if: ${{ inputs.cacheOnly == 'false' }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/build/windows/action.yml b/.github/workflows/build/windows/action.yml index 6d05f4ef1e..819d0676df 100644 --- a/.github/workflows/build/windows/action.yml +++ b/.github/workflows/build/windows/action.yml @@ -179,6 +179,43 @@ runs: mkdir -p install cp -r $TEMPD/* install/ + - name: Test + if: ${{ inputs.cacheOnly == 'false' }} + shell: bash + run: | + Qt6_DIR="${RUNNER_TEMP}\qt\${{ inputs.qtVersion }}\msvc2019_64" + ANTLR_EXE="${RUNNER_TEMP}\antlr-${{ inputs.antlrVersion }}-complete.jar" + export PATH="${Qt6_DIR}\bin;$PATH" + INCLUDE="${RUNNER_TEMP}\freetype-latest;$INCLUDE" + LIB="${RUNNER_TEMP}\freetype-install\lib;${RUNNER_TEMP}\freetype-install\bin;$LIB" + INCLUDE="${RUNNER_TEMP}\ftgl-latest\src;$INCLUDE" + LIB="${RUNNER_TEMP}\ftgl-install\lib;$LIB" + JAVA_EXE="${JAVA_HOME_21_X64}\bin\java.exe" + cd build + + # Run windeployqt on the main Dissolve-GUI-QML binary to pull in Qt library requirements + ${Qt6_DIR}/bin/windeployqt.exe bin/Dissolve-GUI-QML.exe + + # Assemble external library requirements + export DEPLOY_DIR="${GITHUB_WORKSPACE}\build" + export FREETYPE_DIR="${RUNNER_TEMP}\freetype-install\bin" + export FTGL_DIR="${RUNNER_TEMP}\ftgl-install\bin" + #cp -v ${DEPLOY_DIR}/install/bin/* ./bin + cp -v ${FREETYPE_DIR}/freetype.dll ./bin + cp -v ${FTGL_DIR}/ftgl.dll ./bin + cp -v ${DEPLOY_DIR}/direct_deploy/onetbb/bin/tbb12.dll ./bin + cp -v ${DEPLOY_DIR}/direct_deploy/onetbb/bin/tbbmalloc.dll ./bin + cp -v ${DEPLOY_DIR}/direct_deploy/onetbb/bin/tbbmalloc_proxy.dll ./bin + cp -v ${DEPLOY_DIR}/direct_deploy/onetbb/bin/tbbbind_2_5.dll ./bin + cp -v ${DEPLOY_DIR}/direct_deploy/antlr4-cppruntime/bin/antlr4-runtime.dll ./bin + + # Build the test binaries + cmake ../ -G Ninja -DCMAKE_BUILD_TYPE:STRING="Release" -DCMAKE_C_COMPILER=cl -DANTLR_EXECUTABLE:string=$ANTLR_EXE -DJava_JAVA_EXECUTABLE:string=$JAVA_EXE -DCMAKE_CXX_COMPILER=cl -DMULTI_THREADING:bool=${{ inputs.threading }} -DGUI:bool=true -DCMAKE_INSTALL_PREFIX:PATH=$TEMPD -DBUILD_TESTS:bool=ON + cmake --build . --config Release + + # Run the tests + ctest --output-on-failure + - name: Upload Raw Build Artifacts if: ${{ inputs.cacheOnly == 'false' }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4088cc6a9b..8191539854 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -25,14 +25,8 @@ jobs: with: checkoutRef: ${{ github.event.pull_request.head.sha }} - QC: - needs: [Checkout] - uses: "./.github/workflows/_qc.yml" - with: - nixHash: ${{ needs.Checkout.outputs.nixHash }} - BuildAndPackage: - needs: [Checkout] + needs: Checkout uses: "./.github/workflows/_build_and_package.yml" with: benchmark: false @@ -51,11 +45,3 @@ jobs: with: branch: 'refs/pull/${{ github.event.pull_request.number }}/merge' - Web: - needs: [Checkout] - uses: "./.github/workflows/_website.yml" - with: - publishType: 'none' - displayMajorVersion: ${{ needs.Checkout.outputs.currentVersionMajor }} - displayMinorVersion: ${{ needs.Checkout.outputs.currentVersionMinor }} - hugoVersion: ${{ needs.Checkout.outputs.hugoVersion }} diff --git a/conanfile.py b/conanfile.py index 8e87c8eae0..c568fbbc93 100644 --- a/conanfile.py +++ b/conanfile.py @@ -7,11 +7,16 @@ class DissolveRecipe(ConanFile): name = "Dissolve" settings = "os", "compiler", "build_type", "arch" generators = "CMakeToolchain", "CMakeDeps" + deployers = "direct_deploy" options = { "msvc_dev": [True, False], + "tests": [True, False], + "benchmarks": [True, False], } default_options = { "msvc_dev": False, + "tests": True, + "benchmarks": False, } def configure(self): self.options["puxixml"].header_only = False @@ -32,8 +37,9 @@ def requirements(self): self.requires("antlr4-cppruntime/4.13.1") self.requires("gsl/2.7.1") - if self.settings.os == "Linux" or (self.options.msvc_dev and self.settings.build_type == "Debug"): + if self.options.tests: self.requires("gtest/1.17.0") + if self.options.benchmarks: self.requires("benchmark/1.8.4") def build_requirements(self): diff --git a/src/gui/models/CMakeLists.txt b/src/gui/models/CMakeLists.txt index bf5bde12d6..7685cc453b 100644 --- a/src/gui/models/CMakeLists.txt +++ b/src/gui/models/CMakeLists.txt @@ -26,7 +26,7 @@ set(models_MOC_HDRS generatorModel.h generatorNodeModel.h rangeVectorModel.h - renderableGroupManagerModel.h +# renderableGroupManagerModel.h simpleForcefieldModel.h sitesFilterProxy.h sitesModel.h @@ -88,7 +88,7 @@ set(models_SRCS generatorModelMimeData.h generatorNodeModel.cpp rangeVectorModel.cpp - renderableGroupManagerModel.cpp +# renderableGroupManagerModel.cpp simpleForcefieldModel.cpp sitesFilterProxy.cpp sitesModel.cpp diff --git a/src/gui/widgets/CMakeLists.txt b/src/gui/widgets/CMakeLists.txt index 1c4771691c..9a81136b63 100755 --- a/src/gui/widgets/CMakeLists.txt +++ b/src/gui/widgets/CMakeLists.txt @@ -9,8 +9,8 @@ add_library( elementSelector.h exponentialSpin.cpp exponentialSpin.h - gradientBar.cpp - gradientBar.h + # gradientBar.cpp + # gradientBar.h integerSpin.cpp integerSpin.h noControls.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c9ea7c34d7..85c3fcf17a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -47,8 +47,8 @@ function(dissolve_add_test) target_include_directories(${TEST_NAME} PRIVATE ${Qt6Widgets_INCLUDE_DIRS}) target_link_libraries( ${TEST_NAME} - PUBLIC models widgets render delegates - PRIVATE Qt6::Core Qt6::Widgets + PUBLIC models widgets delegates gui-qml + PRIVATE Qt6::Quick3D Qt6::Qml Qt6::Widgets ) endif(DISSOLVE_UNIT_TEST_GUI) diff --git a/tests/math/interpolator.cpp b/tests/math/interpolator.cpp index 5cf0b8646a..52fbce55d3 100644 --- a/tests/math/interpolator.cpp +++ b/tests/math/interpolator.cpp @@ -99,12 +99,12 @@ TEST_F(InterpolatorTest, RegularBasic) // Form interpolation of data and check interpolation at known values Interpolator I(regularData_); for (auto &&[x, y] : zip(regularData_.xAxis(), regularData_.values())) - EXPECT_DOUBLE_EQ(y, I.y(x)); + EXPECT_NEAR(y, I.y(x), 1.0e-10); auto x = 0.0; for (auto y : regularFineY_) { - EXPECT_DOUBLE_EQ(y, I.y(x)); + EXPECT_NEAR(y, I.y(x), 1.0e-10); x += fineDeltaX; } } @@ -127,8 +127,8 @@ TEST_F(InterpolatorTest, RegularSequentialTest) // Check against pre-calculated y values not present in the source data for (auto &&[x, y, interpy] : zip(fineBins.xAxis(), regularFineY_, fineBins.values())) { - EXPECT_DOUBLE_EQ(y, I.y(x)); - EXPECT_DOUBLE_EQ(y, interpy); + EXPECT_NEAR(y, I.y(x), 1.0e-10); + EXPECT_NEAR(y, interpy, 1.0e-10); } }