Skip to content

Commit ccaf84d

Browse files
authored
[CI] Fix ccache and OpenCV paths on Windows (#207)
1 parent 0ae7730 commit ccaf84d

3 files changed

Lines changed: 14 additions & 26 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,21 @@ jobs:
137137
- uses: actions/checkout@v4
138138
with:
139139
submodules: true
140+
- name: Add msbuild to PATH
141+
uses: microsoft/setup-msbuild@v2
142+
with:
143+
vs-version: 'latest'
140144
- name: Setup ccache
141-
uses: hendrikmuhs/ccache-action@v1.2
145+
uses: Chocobo1/setup-ccache-action@v1
142146
with:
143-
key: ccache-${{ github.job }}
144-
max-size: 2G
145-
variant: sccache
147+
windows_compile_environment: msvc
148+
- name: Setup ninja
149+
uses: seanmiddleditch/gha-setup-ninja@v6
150+
- name: Setup MSVC for Ninja again
151+
uses: ilammy/msvc-dev-cmd@v1
146152
- name: Build
147153
run: |
148-
cmake -S . -B build -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release
154+
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release
149155
cmake --build build --parallel --config Release
150156
- name: Test
151157
run: |

app/Graph/CMakeLists.txt

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,16 @@ if (NOT CMAKE_BUILD_TYPE)
2626
endif()
2727

2828
if (WIN32)
29-
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
30-
set(CMAKE_BUILD_TYPE "Debug")
31-
endif()
32-
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
33-
set(CMAKE_BUILD_TYPE "Release")
34-
endif()
3529
add_custom_command(TARGET Graph_Build POST_BUILD
3630
COMMAND ${CMAKE_COMMAND} -E copy_directory
37-
"${OPENCV_BUILD_DIR}/bin/${CMAKE_BUILD_TYPE}/."
31+
"${OPENCV_BUILD_DIR}/bin/."
3832
"${CMAKE_BINARY_DIR}/bin/")
3933
endif()
4034

4135
if (WIN32)
42-
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
43-
set(CMAKE_BUILD_TYPE "Debug")
44-
endif()
45-
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
46-
set(CMAKE_BUILD_TYPE "Release")
47-
endif()
4836
add_custom_command(TARGET ACC_MNIST POST_BUILD
4937
COMMAND ${CMAKE_COMMAND} -E copy_directory
50-
"${OPENCV_BUILD_DIR}/bin/${CMAKE_BUILD_TYPE}/."
38+
"${OPENCV_BUILD_DIR}/bin/."
5139
"${CMAKE_BINARY_DIR}/bin/")
5240
endif()
5341

test/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ if (NOT CMAKE_BUILD_TYPE)
1818
endif()
1919

2020
if (WIN32)
21-
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
22-
set(CMAKE_BUILD_TYPE "Debug")
23-
endif()
24-
if ("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
25-
set(CMAKE_BUILD_TYPE "Release")
26-
endif()
2721
add_custom_command(TARGET run_test POST_BUILD
2822
COMMAND ${CMAKE_COMMAND} -E copy_directory
29-
"${OPENCV_BUILD_DIR}/bin/${CMAKE_BUILD_TYPE}/."
23+
"${OPENCV_BUILD_DIR}/bin/."
3024
"${CMAKE_BINARY_DIR}/bin/")
3125
endif()
3226

0 commit comments

Comments
 (0)