Skip to content

Commit 8770e9e

Browse files
committed
don't build tests by default
1 parent 2bf5cb4 commit 8770e9e

File tree

4 files changed

+23
-47
lines changed

4 files changed

+23
-47
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ on:
77
- "**.cmake"
88
- "**/CMakeLists.txt"
99
- ".github/workflows/ci.yml"
10+
workflow_dispatch:
11+
12+
# avoid wasted runs
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
1017

1118
jobs:
1219

@@ -20,15 +27,16 @@ jobs:
2027
timeout-minutes: 5
2128

2229
steps:
23-
- uses: actions/checkout@v4
30+
- &checkout
31+
uses: actions/checkout@v4
2432

25-
- run: cmake --workflow --preset default
33+
- run: cmake --workflow default
2634

2735
windows_msvc:
2836
runs-on: windows-latest
2937
timeout-minutes: 5
3038

3139
steps:
32-
- uses: actions/checkout@v4
40+
- *checkout
3341

34-
- run: cmake --workflow --preset msvc
42+
- run: cmake --workflow release

CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
cmake_minimum_required(VERSION 3.14...3.28)
1+
cmake_minimum_required(VERSION 3.16...4.1)
2+
3+
if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED ENV{CMAKE_BUILD_TYPE})
4+
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
5+
endif()
26

37
project(GKlib LANGUAGES C
48
VERSION 1.0.0
59
)
610

711
enable_testing()
812

9-
option(BUILD_TESTING "Build tests" ON)
13+
include(GNUInstallDirs)
14+
15+
option(BUILD_TESTING "Build tests")
1016

11-
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
17+
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)")
1218

1319
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND GKlib_IS_TOP_LEVEL)
1420
set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/local" CACHE PATH "install prefix" FORCE)
@@ -34,7 +40,7 @@ error.c gk_util.c itemsets.c rw.c tokenizer.c)
3440
add_library(GKlib ${GKlib_sources} ${win32_sources})
3541
target_include_directories(GKlib PUBLIC
3642
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
37-
$<INSTALL_INTERFACE:include>
43+
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
3844
)
3945
target_link_libraries(GKlib PRIVATE
4046
$<$<BOOL:${UNIX}>:m>

CMakePresets.json

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@
66
"name": "default",
77
"binaryDir": "${sourceDir}/build",
88
"cacheVariables": {
9-
"CMAKE_COMPILE_WARNING_AS_ERROR": true
10-
}
11-
},
12-
{
13-
"name": "msvc", "inherits": "default",
14-
"generator": "Visual Studio 17 2022",
15-
"cacheVariables": {
16-
"CMAKE_COMPILE_WARNING_AS_ERROR": false
9+
"BUILD_TESTING": true
1710
}
1811
}
1912
],
@@ -26,11 +19,6 @@
2619
"name": "release",
2720
"configurePreset": "default",
2821
"configuration": "Release"
29-
},
30-
{
31-
"name": "msvc-debug",
32-
"configurePreset": "msvc",
33-
"configuration": "Debug"
3422
}
3523
],
3624
"testPresets": [
@@ -51,11 +39,6 @@
5139
{
5240
"name": "release", "inherits": "default",
5341
"configuration": "Release"
54-
},
55-
{
56-
"name": "msvc-debug", "inherits": "default",
57-
"configurePreset": "msvc",
58-
"configuration": "Debug"
5942
}
6043
],
6144
"workflowPresets": [
@@ -76,23 +59,6 @@
7659
}
7760
]
7861
},
79-
{
80-
"name": "msvc",
81-
"steps": [
82-
{
83-
"type": "configure",
84-
"name": "msvc"
85-
},
86-
{
87-
"type": "build",
88-
"name": "msvc-debug"
89-
},
90-
{
91-
"type": "test",
92-
"name": "msvc-debug"
93-
}
94-
]
95-
},
9662
{
9763
"name": "release",
9864
"steps": [

cmake/config.cmake.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,4 @@
22

33
include(${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake)
44

5-
set(ffilesystem_shaky @ffilesystem_shaky@)
6-
7-
target_link_libraries(metis::metis INTERFACE GKlib)
8-
95
check_required_components(@PROJECT_NAME@)

0 commit comments

Comments
 (0)