Skip to content

Commit 8eb3515

Browse files
committed
CI for windows
1 parent 62f6c5c commit 8eb3515

File tree

1 file changed

+40
-12
lines changed

1 file changed

+40
-12
lines changed

.github/workflows/linux.yml renamed to .github/workflows/ci.yml

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1-
name: Linux
1+
name: CI
22

33
on: [push, pull_request]
44

5+
defaults:
6+
run:
7+
shell: bash
8+
59
jobs:
610
tests:
711
runs-on: ${{ matrix.os }}
@@ -14,6 +18,8 @@ jobs:
1418
drafts: ["ON"]
1519
libzmq: ["4.3.4"]
1620
libzmqbuild: ["cmake"]
21+
platform: [""]
22+
makeargs: ["-j2"]
1723
include:
1824
# older libzmq and gcc without draft
1925
- os: "ubuntu-18.04"
@@ -57,14 +63,34 @@ jobs:
5763
drafts: "ON"
5864
libzmq: "4.3.4"
5965
libzmqbuild: "cmake"
66+
# windows
67+
- os: "windows-2016"
68+
cppstd: "14"
69+
cc: "msbuild"
70+
cxx: "msbuild"
71+
drafts: "ON"
72+
libzmq: "4.3.4"
73+
libzmqbuild: "cmake"
74+
platform: "-Ax64"
75+
makeargs: ""
76+
- os: "windows-latest"
77+
cppstd: "20"
78+
cc: "msbuild"
79+
cxx: "msbuild"
80+
drafts: "ON"
81+
libzmq: "4.3.4"
82+
libzmqbuild: "cmake"
83+
platform: "-Ax64"
84+
makeargs: ""
6085

6186
env:
6287
CC: ${{ matrix.cc }}
6388
CXX: ${{ matrix.cxx }}
6489
VERBOSE: 1
6590
THREADS: 2
66-
LIBZMQ: /tmp/libzmq-build
67-
CPPZMQ: /tmp/cppzmq-build
91+
LIBZMQ: ${{ env.GITHUB_WORKSPACE }}/libzmq-build
92+
CPPZMQ: ${{ env.GITHUB_WORKSPACE }}/cppzmq-build
93+
BUILDTYPE: "Debug"
6894
COVERAGE: "OFF" # TODO
6995

7096
steps:
@@ -83,34 +109,36 @@ jobs:
83109
- name: build_libzmq_cmake
84110
if: ${{ matrix.libzmqbuild == 'cmake' }}
85111
run: |
86-
cmake -Hlibzmq-${{ matrix.libzmq }} -B${LIBZMQ} \
112+
cmake -Hlibzmq-${{ matrix.libzmq }} -B${LIBZMQ} ${{ matrix.platform}} \
87113
-DWITH_PERF_TOOL=OFF \
88114
-DZMQ_BUILD_TESTS=OFF \
89115
-DCMAKE_BUILD_TYPE=Release \
90116
-DENABLE_DRAFTS=${{ matrix.drafts }}
91-
cmake --build ${LIBZMQ} -- -j${THREADS}
117+
cmake --build ${LIBZMQ} -- ${{ matrix.makeargs }}
92118
93119
- name: build_libzmq_pkgconfig
94120
if: ${{ matrix.libzmqbuild == 'pkgconfig' }}
95121
working-directory: libzmq-${{ matrix.libzmq }}
96122
run: |
97123
./autogen.sh &&
98124
./configure --prefix=${LIBZMQ} &&
99-
make -j${THREADS}
125+
make ${{ matrix.makeargs }}
100126
make install
101127
102128
- name: build
103129
env:
104130
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}
105131
run: |
106-
cmake -H. -B${CPPZMQ} -DENABLE_DRAFTS=${{ matrix.drafts }} \
107-
-DCOVERAGE=${COVERAGE} \
108-
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
109-
cmake --build ${CPPZMQ} -- -j${THREADS}
132+
cmake -H. -B${CPPZMQ} ${{ matrix.platform}} \
133+
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
134+
-DENABLE_DRAFTS=${{ matrix.drafts }} \
135+
-DCOVERAGE=${COVERAGE} \
136+
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
137+
cmake --build ${CPPZMQ} -- ${{ matrix.makeargs }}
110138
111139
- name: test
112140
working-directory: ${{ env.CPPZMQ }}
113-
run: ctest -V -j${THREADS}
141+
run: ctest -V -C ${BUILDTYPE}
114142

115143
- name: demo
116144
env:
@@ -119,4 +147,4 @@ jobs:
119147
cmake -Hdemo -Bdemo/build
120148
cmake --build demo/build
121149
cd demo/build
122-
ctest -V
150+
ctest -V -C ${BUILDTYPE}

0 commit comments

Comments
 (0)