diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 8e54992..e011b8c 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -15,36 +15,43 @@ on: branches: - master paths: - - '.github/workflows/test-cpp-linux.yml' + - '.github/workflows/test-linux.yml' - 'benchmarks/**' - 'examples/**' - 'sf_compressor/**' - 'sources/**' - 'tests/**' - 'CMakeLists.txt' + jobs: deploy: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: build_type: [ Debug, Release ] + os: [ ubuntu-latest, windows-latest ] + steps: - uses: actions/checkout@v2 - with: - submodules: recursive + - name: Build tests, benchmarks and examples run: | mkdir build cd build cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DSFC_BUILD_TESTS=ON -DSFC_BUILD_BENCHMARKS=ON -DSFC_BUILD_EXAMPLES=ON .. cmake --build . + - name: Run tests run: | cd build ctest --output-on-failure + - name: Install sf_compressor + if: matrix.os == 'ubuntu-latest' run: | cd build sudo cmake --install . + - name: Check cmake target installation + if: matrix.os == 'ubuntu-latest' run: cmake --find-package -DNAME=sf_compressor -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e6d4d9..b074ff2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,8 @@ set(SFC_TARGET_NAME ${PROJECT_NAME}) # Create sfc target add_library(${SFC_TARGET_NAME} sources/sf_compressor.cc) -target_compile_features(${SFC_TARGET_NAME} PUBLIC cxx_std_17) +target_compile_features(${SFC_TARGET_NAME} PUBLIC cxx_std_20) +set_target_properties(${SFC_TARGET_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON) # Include paths target_include_directories(${SFC_TARGET_NAME} PUBLIC @@ -23,9 +24,10 @@ include(FetchContent) if (SFC_BUILD_TESTS OR SFC_BUILD_BENCHMARKS) FetchContent_Declare( Catch2 - GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.0.0-preview3) - + URL https://github.com/catchorg/Catch2/archive/refs/tags/v3.0.1.tar.gz + URL_HASH + SHA256=8c4173c68ae7da1b5b505194a0c2d6f1b2aef4ec1e3e7463bde451f26bbaf4e7 + ) FetchContent_MakeAvailable(Catch2) list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)