From f689ed2eb8ce77c05056c1b562e9e54aa0e9efd0 Mon Sep 17 00:00:00 2001 From: Pierrick HYMBERT Date: Sat, 16 Dec 2023 22:28:46 +0100 Subject: [PATCH] Enable build testing in cmake github workflow --- .github/workflows/cmake-win64.yml | 2 +- .github/workflows/cmake.yml | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake-win64.yml b/.github/workflows/cmake-win64.yml index d144f75919..94012918d8 100644 --- a/.github/workflows/cmake-win64.yml +++ b/.github/workflows/cmake-win64.yml @@ -96,7 +96,7 @@ jobs: - name: Build and Install tesseract shell: cmd run: | - cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DENABLE_LTO=ON -DBUILD_TRAINING_TOOLS=OFF -DFAST_FLOAT=ON -DGRAPHICS_DISABLED=ON -DOPENMP_BUILD=OFF + cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{env.ILOC}} -DCMAKE_INSTALL_PREFIX=${{env.ILOC}} -DSW_BUILD=OFF -DBUILD_SHARED_LIBS=ON -DENABLE_LTO=ON -DBUILD_TRAINING_TOOLS=OFF -DBUILD_TESTING=ON -DFAST_FLOAT=ON -DGRAPHICS_DISABLED=ON -DOPENMP_BUILD=OFF cmake --build build --config Release --target install - name: Upload Build Results diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 5e6750e049..fe56ff5b1b 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -74,6 +74,7 @@ jobs: -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DOPENMP_BUILD=OFF \ + -DBUILD_TESTING=ON \ -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ -DCMAKE_INSTALL_PREFIX:PATH=inst if: runner.os == 'Linux' @@ -93,6 +94,7 @@ jobs: -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DOPENMP_BUILD=OFF \ + -DBUILD_TESTING=ON \ -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ -DCMAKE_INSTALL_PREFIX:PATH=inst if: runner.os == 'macOS' @@ -133,18 +135,12 @@ jobs: - name: Build and run basicapitest (Linux) run: | - export "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build/inst/lib/pkgconfig/:$PKG_CONFIG_PATH" - cd test - ${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp "-I$GITHUB_WORKSPACE/build/inst/include" "-L$GITHUB_WORKSPACE/build/inst/lib" $(pkg-config --cflags --libs tesseract lept libarchive libcurl) -pthread -std=c++11 - ./basicapitest + build/inst/bin/basicapi_test if: runner.os == 'Linux' - name: Build and run basicapitest (macOS) run: | - export "PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build/inst/lib/pkgconfig/:$(brew --prefix)/opt/libarchive/lib/pkgconfig:$(brew --prefix)/Library/Homebrew/os/mac/pkgconfig/11:$PKG_CONFIG_PATH" - cd test - ${{ matrix.config.cxx }} -o basicapitest testing/basicapitest.cpp "-I$GITHUB_WORKSPACE/build/inst/include" "-L$GITHUB_WORKSPACE/build/inst/lib" $(pkg-config --cflags --libs tesseract lept libcurl) -pthread -std=c++11 - ./basicapitest + build/bin/basicapi_test if: runner.os == 'macOS' - name: Display Compiler Version