forked from hku-ect/gazebosc
-
Notifications
You must be signed in to change notification settings - Fork 0
144 lines (130 loc) · 5.16 KB
/
cmake.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CMake
on:
push:
branches:
- '*'
tags:
- '*'
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
env: ${{ matrix.env }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
env:
BUILD_TYPE: Debug
- os: macos-12
env:
BUILD_TYPE: Debug
CMAKE_GENERATOR: Xcode
- os: self-hosted
env:
BUILD_TYPE: Debug
MACOSX_DEPLOYMENT_TARGET: 10.15
CMAKE_GENERATOR: Xcode
- os: windows-2019
env:
WITH_LIBSODIUM: ON
ENABLE_CURVE: ON
CMAKE_GENERATOR: Visual Studio 16 2019
MSVCVERSION: v142
MSVCYEAR: vs2019
ARTIFACT_NAME: v142-x64
ENABLE_DRAFTS: ON
LIBZMQ_SRCDIR: ${{ github.workspace }}\libzmq
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
if: matrix.os == 'windows-2019'
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: add Debian Packages
if: matrix.os == 'ubuntu-latest'
uses: myci-actions/add-deb-repo@10
with:
repo-name: obs
repo: deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_22.04/ ./
keys-asc: https://download.opensuse.org/repositories/network:/messaging:/zeromq:/git-draft/xUbuntu_22.04/Release.key
install: libzmq5 libzmq3-dev libglx-dev mesa-common-dev libasound2-dev libglew-dev libunwind-dev libmicrohttpd-dev
- name: Add brew packages
if: ${{ contains( matrix.os, 'macos' ) }}
shell: bash
run: brew install automake libmicrohttpd
# libzmq
- uses: actions/checkout@v2
with:
path: libzmq
- name: libZMQ Dep
if: ${{ contains( matrix.os, 'macos' ) }}
working-directory: libzmq
run: |
./autogen.sh
./configure
make
sudo make install
- run: md build_libzmq
shell: cmd
if: matrix.os == 'windows-2019'
- name: libzmq build win
if: matrix.os == 'windows-2019'
shell: cmd
working-directory: build_libzmq
run: |
cmake -D WITH_LIBSODIUM="OFF" -D ENABLE_DRAFTS="ON" -G "%CMAKE_GENERATOR%" ${{ github.workspace }}/libzmq
cmake --build . --config release --target install -- -verbosity:Minimal -maxcpucount
# - name: Cache CPython Build
# id: cpython-build-cache
# uses: actions/cache@v3
# with:
# path: ${{github.workspace}}/build/python
# key: ${{ runner.os }}-${{ hashFiles('dist/osx/build_python.sh') }}
# - name: Build Python dep
# if: ${{ matrix.os != 'ubuntu-latest' && steps.cpython-build-cache.outputs.cache-hit != 'true' }}
# run: |
# ./dist/osx/build_python.sh ${{github.workspace}}/build/python
- uses: actions/setup-python@v5
#if: matrix.os == 'windows-2019'
with:
python-version: '3.9'
- name: Extract Python Info
if: ${{ matrix.os != 'ubuntu-latest' }}
run: |
PY_ROOT=`python3 -c "import sys, os;print(os.path.abspath(sys.base_prefix))"`
echo "CMAKE_OPTIONS=-DPython3_ROOT_DIR=$PY_ROOT -DWITH_EMBED_PYTHON=ON -DWITH_OPENVR=OFF -DWITH_DEV=OFF" >> $GITHUB_ENV
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} $CMAKE_OPTIONS
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Pack
if: ${{ matrix.os != 'ubuntu-latest' }}
working-directory: ${{github.workspace}}/build
run: cpack -V -C ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} -VV
- name: Upload file via SSH only on push
working-directory: ${{github.workspace}}/build
if: github.event_name == 'push'
env:
BBPWD: ${{ secrets.BBPWD }}
run: |
git fetch --all --tags
if [ "${RUNNER_OS}" == "Linux" ]; then zip -q -r $( echo $GITHUB_REPOSITORY | cut -d"/" -f2)_${RUNNER_OS}_$( git describe --tag --always --dirty --abbrev=4).zip * -x "*/test/*" "*/__pycache__/*"; fi
echo 'pong.hku.nl,37.97.171.71 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFxUlmYnS6gItSE4QuXpJxVFqhatyadmYaSQ+GPYwna9bs3KoWxfYl2j0ijA4aVAPPZLjLAjNbxd26fIrocW5fQ=' >> ./known_hosts
git clone https://github.com/clarkwang/passh.git
cd passh
cc -o passh passh.c
./passh -p env:BBPWD scp -o UserKnownHostsFile=../known_hosts ../gazebosc_*_* buildbot@pong.hku.nl:public_html/gazebosc/
rm ../known_hosts