diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70a98d1..a677425 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,18 @@ # This specific template is located at: # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml +default: + image: saas-linux-small-amd64 + tags: [linux] + before_script: + - pip install -r requirements.txt + +.standard-rules: # Make a hidden job to hold the common rules + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_PIPELINE_SOURCE == 'merge_request_event' + + stages: # List of stages for jobs, and their order of execution - build - test @@ -23,6 +35,8 @@ stages: # List of stages for jobs, and their order of execution build-job: # This job runs in the build stage, which runs first. stage: build + extends: + - .standard-rules # Reuse the configuration in `.standard-rules` here script: - echo "Compiling the code..." - cmake --preset default @@ -31,13 +45,17 @@ build-job: # This job runs in the build stage, which runs first. unit-test-job: # This job runs in the test stage. stage: test # It only starts when the job in the build stage completes successfully. + extends: + - .standard-rules # Reuse the configuration in `.standard-rules` here script: - - echo "Running unit tests... This will take about 60 seconds." + - echo "Running unit tests... This will take about a view seconds." - cmake --build --preset default --target test - gcovr . lint-test-job: # This job also runs in the test stage. stage: test # It can run at the same time as unit-test-job (in parallel). + extends: + - .standard-rules # Reuse the configuration in `.standard-rules` here script: - echo "Linting code... This will take about 10 seconds." - run-clang-tidy -p build @@ -45,6 +63,8 @@ lint-test-job: # This job also runs in the test stage. deploy-job: # This job runs in the deploy stage. stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH environment: production script: - echo "Deploying application..." diff --git a/CMakeLists.txt b/CMakeLists.txt index 9903f33..515e153 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_CXX_EXTENSIONS NO) # =============================== project( tftpd # ORIG: netkit-tftp v0.17.6 - VERSION 1.0.0 + VERSION 1.0.0.1 LANGUAGES CXX ) # =============================== @@ -40,10 +40,10 @@ find_package(Threads REQUIRED) include(cmake/CPM.cmake) # PackageProject.cmake will be used to make our target installable -CPMAddPackage("gh:TheLartians/PackageProject.cmake@1.10.0") +CPMAddPackage("gh:TheLartians/PackageProject.cmake@1.11.0") # see https://github.com/aminya/project_options for more info -CPMAddPackage("gh:aminya/project_options@0.26.1") +CPMAddPackage("gh:aminya/project_options@0.32.1") # XXX list(APPEND CMAKE_MODULE_PATH ${project_options_SOURCE_DIR}) add_library( @@ -56,7 +56,9 @@ add_library( tftp_subs.cpp tftp/tftpsubs.h ) -target_link_libraries(${PROJECT_NAME} PUBLIC Boost::filesystem Boost::headers Threads::Threads) +target_link_libraries( + ${PROJECT_NAME} PUBLIC Boost::filesystem Boost::headers Threads::Threads +) target_compile_definitions(${PROJECT_NAME} PUBLIC BOOST_ASIO_NO_DEPRECATED) target_include_directories( ${PROJECT_NAME} PUBLIC $ @@ -64,8 +66,6 @@ target_include_directories( ) if(PROJECT_IS_TOP_LEVEL AND CMAKE_BUILD_TYPE STREQUAL "Debug") - set(CMAKE_SKIP_INSTALL_RULES TRUE) - project_options( PREFIX ${PROJECT_NAME} @@ -81,13 +81,12 @@ if(PROJECT_IS_TOP_LEVEL AND CMAKE_BUILD_TYPE STREQUAL "Debug") # ENABLE_INCLUDE_WHAT_YOU_USE ) - if(CMAKE_SKIP_INSTALL_RULES) - # FIXME: should be PRIVATE! CK - target_link_libraries( - ${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_project_warnings - ${PROJECT_NAME}_project_options - ) - endif() + # FIXME: should be PRIVATE! CK + target_link_libraries( + ${PROJECT_NAME} + PUBLIC $ + $ + ) else() include(cmake/WarningsAsErrors.cmake) endif() diff --git a/requirements.txt b/requirements.txt index 6528a13..b4e5d68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,18 +1,18 @@ # ============================================================================= # PYTHON PACKAGES (PIP) # ============================================================================= -# USE (python3): sudo pip3 install -r +# USE (python3): pip3 install -r # ============================================================================= -PyYAML>=5.4.1,<6.0 -asyncio==3.4.3 +# PyYAML>=5.4.1,<6.0 +# asyncio==3.4.3 builddriver==0.9.0 bumpversion>=0.6.0 cmake-format>=0.6.13 cmake>=3.25 gcovr>=5.2 ninja>=1.11 -pytest-asyncio==0.19.0 -pytest==7.1.3 +# pytest-asyncio==0.19.0 +# pytest==7.1.3 tftpy>=0.8.2 wheel>=0.37.1