Skip to content

Commit 381263b

Browse files
an-taoBertrandD
andauthored
Add github actions of Windows (#139)
Co-authored-by: Bertrand Darbon <bertrand.darbon@gmail.com>
1 parent a3cb939 commit 381263b

File tree

2 files changed

+53
-2
lines changed

2 files changed

+53
-2
lines changed

.github/workflows/cmake.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,47 @@ env:
1111
BUILD_TYPE: Release
1212

1313
jobs:
14-
build:
14+
windows:
15+
name: 'windows/msvc - ${{matrix.link}}'
16+
runs-on: windows-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
link: [ 'STATIC', 'SHARED' ]
21+
steps:
22+
- name: Checkout Trantor source code
23+
uses: actions/checkout@v2
24+
with:
25+
submodules: false
26+
27+
- name: Install dependencies
28+
run: |
29+
pip install conan
30+
31+
- name: Create build directory
32+
run: |
33+
mkdir build
34+
35+
- name: Install conan packages
36+
shell: pwsh
37+
working-directory: ./build
38+
run: |
39+
conan install .. -s compiler="Visual Studio" -s compiler.version=16 -sbuild_type=Debug -g cmake_paths
40+
41+
- name: Create Build Environment & Configure Cmake
42+
shell: bash
43+
working-directory: ./build
44+
run: |
45+
[[ ${{ matrix.link }} == "SHARED" ]] && shared="ON" || shared="OFF"
46+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=on -DBUILD_TRANTOR_SHARED=$shared -DCMAKE_TOOLCHAIN_FILE="conan_paths.cmake" -DCMAKE_INSTALL_PREFIX=../install
47+
48+
- name: Build
49+
working-directory: ${{env.GITHUB_WORKSPACE}}
50+
shell: bash
51+
run: |
52+
cd build
53+
cmake --build . --target install --parallel
54+
unix:
1555
name: ${{matrix.buildname}}
1656
runs-on: ${{matrix.os}}
1757
strategy:
@@ -92,4 +132,4 @@ jobs:
92132
if: matrix.os == 'ubuntu-20.04'
93133
working-directory: ${{env.GITHUB_WORKSPACE}}
94134
shell: bash
95-
run: ./format.sh && git diff --exit-code
135+
run: ./format.sh && git diff --exit-code

conanfile.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[requires]
2+
gtest/1.10.0
3+
openssl/1.1.1j
4+
#c-ares/1.17.1
5+
6+
[generators]
7+
cmake_paths
8+
9+
[options]
10+
11+
[imports]

0 commit comments

Comments
 (0)