@@ -2,48 +2,111 @@ name: CMake
2
2
3
3
on : [push]
4
4
5
- env :
6
- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7
- BUILD_TYPE : Release
8
-
9
5
jobs :
10
- build :
11
- # The CMake configure and build commands are platform agnostic and should work equally
12
- # well on Windows or Mac. You can convert this to a matrix build if you need
13
- # cross-platform coverage.
14
- # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
6
+ build_on_ubuntu_gcc :
15
7
runs-on : ubuntu-latest
8
+ steps :
9
+ - uses : actions/checkout@v3
10
+
11
+ - name : Install Pybind11 ubuntu
12
+ run : sudo apt install python3-pybind11
13
+
14
+ - name : cmake
15
+ run : >
16
+ cmake -B ${{ github.workspace }}/build
17
+ -DCMAKE_BUILD_TYPE=Release
18
+ -DCMAKE_C_COMPILER=gcc
19
+ -DCMAKE_CXX_COMPILER=g++
20
+ -S ${{github.workspace}}
21
+
22
+ - name : Build
23
+ run : cmake --build ${{ github.workspace }}/build --config Release
24
+
25
+ - name : Test
26
+ working-directory : ${{ github.workspace }}/build
27
+ shell : bash
28
+ run : ctest --build-config Release
29
+
30
+ build_on_ubuntu_clang :
31
+ runs-on : ubuntu-latest
32
+ steps :
33
+ - uses : actions/checkout@v3
16
34
35
+ - name : Install Pybind11 ubuntu
36
+ run : sudo apt install python3-pybind11
37
+
38
+ - name : cmake
39
+ # Some projects don't allow in-source building, so create a separate build directory
40
+ # We'll use this as our working directory for all subsequent commands
41
+ run : >
42
+ cmake -B ${{ github.workspace }}/build
43
+ -DCMAKE_BUILD_TYPE=Release
44
+ -DCMAKE_C_COMPILER=clang
45
+ -DCMAKE_CXX_COMPILER=clang++
46
+ -S ${{github.workspace}}
47
+
48
+ - name : Build
49
+ # Execute the build. You can specify a specific target with "--target <NAME>"
50
+ run : cmake --build ${{ github.workspace }}/build --config Release
51
+
52
+ - name : Test
53
+ working-directory : ${{ github.workspace }}/build
54
+ shell : bash
55
+ run : ctest --build-config Release
56
+
57
+ build_on_macos_clang :
58
+ runs-on : macos-latest
17
59
steps :
18
- - uses : actions/checkout@v2
19
-
20
- - name : Install Pybind11
21
- run : sudo apt install python3-pybind11
22
-
23
- - name : Create Build Environment
24
- # Some projects don't allow in-source building, so create a separate build directory
25
- # We'll use this as our working directory for all subsequent commands
26
- run : cmake -E make_directory ${{github.workspace}}/build
27
-
28
- - name : Configure CMake
29
- # Use a bash shell so we can use the same syntax for environment variable
30
- # access regardless of the host operating system
31
- shell : bash
32
- working-directory : ${{github.workspace}}/build
33
- # Note the current convention is to use the -S and -B options here to specify source
34
- # and build directories, but this is only available with CMake 3.13 and higher.
35
- # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
36
- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
37
-
38
- - name : Build
39
- working-directory : ${{github.workspace}}/build
40
- shell : bash
41
- # Execute the build. You can specify a specific target with "--target <NAME>"
42
- run : cmake --build . --config $BUILD_TYPE
43
-
44
- - name : Test
45
- working-directory : ${{github.workspace}}/build
46
- shell : bash
47
- # Execute tests defined by the CMake configuration.
48
- # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
49
- run : ctest -C $BUILD_TYPE
60
+ - uses : actions/checkout@v3
61
+
62
+ - name : Install Pybind11 macos
63
+ run : brew install pybind11
64
+
65
+ - name : cmake
66
+ run : >
67
+ cmake -B ${{ github.workspace }}/build
68
+ -DCMAKE_BUILD_TYPE=Release
69
+ -DCMAKE_C_COMPILER=clang
70
+ -DCMAKE_CXX_COMPILER=clang++
71
+ -S ${{github.workspace}}
72
+
73
+ - name : Build
74
+ run : cmake --build ${{ github.workspace }}/build --config Release
75
+
76
+ - name : Test
77
+ working-directory : ${{ github.workspace }}/build
78
+ shell : bash
79
+ run : ctest --build-config Release
80
+
81
+ build_on_windows_cl :
82
+ runs-on : windows-latest
83
+ steps :
84
+ - uses : actions/checkout@v3
85
+
86
+ - name : Install Pybind11 windows
87
+ run : >
88
+ git clone https://github.com/Microsoft/vcpkg.git &&
89
+ cd vcpkg &&
90
+ .\bootstrap-vcpkg.bat &&
91
+ .\vcpkg integrate install &&
92
+ vcpkg install pybind11
93
+
94
+ - name : cmake
95
+ # Some projects don't allow in-source building, so create a separate build directory
96
+ # We'll use this as our working directory for all subsequent commands
97
+ run : >
98
+ cmake -B ${{ github.workspace }}/build
99
+ -DCMAKE_BUILD_TYPE=Release
100
+ -DCMAKE_C_COMPILER=cl
101
+ -DCMAKE_CXX_COMPILER=cl
102
+ -S ${{github.workspace}}
103
+
104
+ - name : Build
105
+ # Execute the build. You can specify a specific target with "--target <NAME>"
106
+ run : cmake --build ${{ github.workspace }}/build --config Release
107
+
108
+ - name : Test
109
+ working-directory : ${{ github.workspace }}/build
110
+ shell : bash
111
+ run : ctest --build-config Release
112
+
0 commit comments