81 lines (67 loc) · 3.36 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Build with c++
on: [push, pull_request]
jobs:
compile:
runs-on: ${{ matrix.config.os }}
name: Build-${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
# - {
# name: "Windows Latest MSVC", artifact: "Windows-MSVC.tar.xz",
# os: windows-latest,
# build_type: "Release", cc: "cl", cxx: "cl",
# environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
# }
# - {
# name: "Windows Latest MinGW", artifact: "Windows-MinGW.tar.xz",
# os: windows-latest,
# build_type: "Release", cc: "gcc", cxx: "g++"
# }
- {
name: "Ubuntu Latest GCC", artifact: "Linux.tar.xz",
os: ubuntu-latest,
file_extension: "so"
build_type: "Release", cc: "gcc", cxx: "g++"
}
- {
name: "macOS Latest Clang", artifact: "macOS.tar.xz",
os: macos-latest,
file_extension: "dylib"
build_type: "Release", cc: "clang", cxx: "clang++"
}
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: CMake protobuf
run: cd third_party/protobuf && cmake -B"builds/${{ matrix.config.os }}" -Hcmake -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="builds/${{ matrix.config.os }}/release" -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -fPIC"
- name: Make protobuf
run: cd third_party/protobuf && make -C"builds/${{ matrix.config.os }}" -j8 install
- name: CMake Ubuntu
if: matrix.config.os == 'ubuntu-latest'
run: cmake -B"builds/${{ matrix.config.os }}" -H. -DPYTHON_EXECUTABLE=/usr/bin/python -DCMAKE_INSTALL_PREFIX=third_party/protobuf/builds/${{ matrix.config.os }}/release/ -Dprotobuf_MODULE_COMPATIBLE=1 -DJAVA_HOME=$(readlink -f third_party/jvm/linux64)
- name: CMake Mac
if: matrix.config.os == 'macos-latest'
run: cmake -B"builds/${{ matrix.config.os }}" -H. -DPYTHON_EXECUTABLE=/usr/bin/python -DCMAKE_INSTALL_PREFIX=third_party/protobuf/builds/${{ matrix.config.os }}/release/ -Dprotobuf_MODULE_COMPATIBLE=1 -DJAVA_HOME=$(git rev-parse --show-toplevel)/third_party/jvm/darwin64
- name: Compile
run: make -C"builds/${{ matrix.config.os }}"
- name: Test
run: make -C"builds/${{ matrix.config.os }}" test
- name: List Dependencies Ubuntu
if: matrix.config.os == 'ubuntu-latest'
run: find builds/${{ matrix.config.os }} -name "*.so" -exec echo {} \; -exec ldd {} \;
- name: List Dependencies Mac
if: matrix.config.os == 'macos-latest'
run: find builds/${{ matrix.config.os }} -name "*.dylib" -exec echo {} \; -exec otool -L {} \;
- name: Upload libshmfmu artifact
uses: actions/upload-artifact@v1
with:
name: libshmfmu.${{ matrix.config.file_extension }}
path: builds/${{ matrix.config.os }}/libshmfmu/liblibshmfmu.${{ matrix.config.file_extension }}
- name: Upload libsharedmemory artifact
uses: actions/upload-artifact@v1
with:
name: libsharedmemory.${{ matrix.config.file_extension }}
path: builds/${{ matrix.config.os }}/shmfmi-server/libsharedmemory.${{ matrix.config.file_extension }}