Skip to content

Commit 1d79fcd

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Github Actions] C/C++ for windows.
1 parent a99ebd3 commit 1d79fcd

File tree

3 files changed

+59
-2
lines changed

3 files changed

+59
-2
lines changed

.github/workflows/c-windows.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: C/C++ CMake CI Test
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: ["main"]
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
name: C/C++ CMake CI Test
15+
strategy:
16+
matrix:
17+
os: ["windows-2022"]
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
23+
24+
- name: Install
25+
shell: bash
26+
run: |
27+
if [ "$RUNNER_OS" == "macOS" ]; then
28+
brew install vcpkg
29+
git clone https://github.com/microsoft/vcpkg "$HOME/vcpkg"
30+
export VCPKG_ROOT="$HOME/vcpkg"
31+
echo "VCPKG_ROOT=$HOME/vcpkg" >> $GITHUB_ENV
32+
elif [ "$RUNNER_OS" == "Linux" ]; then
33+
echo "VCPKG_ROOT=/usr/local/share/vcpkg" >> $GITHUB_ENV
34+
elif [ "$RUNNER_OS" == "Windows" ]; then
35+
echo "VCPKG_ROOT=C:/vcpkg" >> $GITHUB_ENV
36+
fi
37+
38+
- name: Check Tools
39+
run: |
40+
echo "-----------"
41+
make --version
42+
echo "-----------"
43+
cmake --version
44+
echo "-----------"
45+
vcpkg --version
46+
echo "-----------"
47+
48+
- name: Install dependencies
49+
run: |
50+
make dependencies
51+
52+
- name: Build
53+
run: |
54+
make build
55+
56+
- name: Test
57+
run: |
58+
make test

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ set(CMAKE_C_STANDARD 11)
1414
set(CMAKE_C_STANDARD_REQUIRED ON)
1515
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1616

17-
SET(GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0")
17+
SET(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage -g -O0")
1818
SET(GCC_COVERAGE_LINK_FLAGS "--coverage")
1919
SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
2020
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")

CMakePresets.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
99
"CMAKE_BUILD_TYPE": "Debug"
1010
},
11-
"generator": "Unix Makefiles",
1211
"binaryDir": "${sourceDir}/build/default"
1312
}
1413
]

0 commit comments

Comments
 (0)