Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 6 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down