Skip to content

Commit

Permalink
Enforce that testing is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
josephbirkner committed Jul 9, 2024
1 parent 1afc220 commit 997b0b5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run: |
python3 -m venv venv && . ./venv/bin/activate
pip install -U setuptools wheel pip conan==2.5.0
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DZSWAG_ENABLE_TESTING=ON ..
- name: Build
working-directory: build
run: |
Expand Down Expand Up @@ -73,7 +73,8 @@ jobs:
cmake -DPython3_ROOT_DIR=$pythonLocation \
-DPython3_FIND_FRAMEWORK=LAST \
-DCMAKE_BUILD_TYPE=Release \
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF ..
-DHTTPLIB_USE_BROTLI_IF_AVAILABLE=OFF \
-DZSWAG_ENABLE_TESTING=ON ..
cmake --build .
mv bin/wheel bin/wheel-auditme # Same as on Linux
mkdir bin/wheel && mv bin/wheel-auditme/zswag*.whl bin/wheel
Expand All @@ -85,7 +86,7 @@ jobs:
working-directory: build
run: |
echo "cmake -DPython3_ROOT_DIR=$env:pythonLocation"
cmake "-DPython3_ROOT_DIR=$env:pythonLocation" -DPython3_FIND_REGISTRY=LAST -DHTTPLIB_USE_ZLIB_IF_AVAILABLE=OFF -DCMAKE_BUILD_TYPE=Release ..
cmake "-DPython3_ROOT_DIR=$env:pythonLocation" -DPython3_FIND_REGISTRY=LAST -DCMAKE_BUILD_TYPE=Release -DZSWAG_ENABLE_TESTING=ON ..
cmake --build . --config Release
- name: Deploy
uses: actions/upload-artifact@v2
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ option(ZSWAG_KEYCHAIN_SUPPORT "Enable zswag keychain support." ON)
option(ZSWAG_ENABLE_TESTING "Enable testing for the project" OFF)

if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
message (STATUS "Testing will be enabled as zswag is the top-level project.")
set (ZSWAG_ENABLE_TESTING ON CACHE BOOL "By default, enable testing if this is the main project")
endif()

Expand Down

0 comments on commit 997b0b5

Please sign in to comment.