forked from modelica/DCPLib
-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (69 loc) · 5.7 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
name: build-test
on:
push:
branches: [ master, dev, testing ]
pull_request:
branches: [ master, dev ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libzip-dev libxerces-c-dev libasio-dev
- 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}}
- name: Build
# Build your program with the given configuration
run: sudo cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install
- name: Configure CMake master example
run: mkdir ${{github.workspace}}/example/master/build && cmake -B ${{github.workspace}}/example/master/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/example/master/
- name: Build master example
run: cmake --build ${{github.workspace}}/example/master/build --config ${{env.BUILD_TYPE}}
- name: Configure CMake slave example
run: mkdir ${{github.workspace}}/example/slave/build && cmake -B ${{github.workspace}}/example/slave/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/example/slave/
- name: Build slave example
run: cmake --build ${{github.workspace}}/example/slave/build --config ${{env.BUILD_TYPE}}
- name: copy Slave-Description to master build
run: cp ${{github.workspace}}/example/master/Example-Slave-Description.xml ${{github.workspace}}/example/master/build/
- name: run examples
run: ${{github.workspace}}/example/slave/build/dcpslave & pid_slave=$! && cd ${{github.workspace}}/example/master/build/ && ./dcpmaster && kill -KILL $pid_slave
- name: Configure CMake struct master master example
run: mkdir ${{github.workspace}}/example/struc_param_master/build && cmake -B ${{github.workspace}}/example/struc_param_master/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/example/struc_param_master/
- name: Build struct master example
run: cmake --build ${{github.workspace}}/example/struc_param_master/build --config ${{env.BUILD_TYPE}}
- name: Configure CMake struct slave example
run: mkdir ${{github.workspace}}/example/struc_param_slave/build && cmake -B ${{github.workspace}}/example/struc_param_slave/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/example/struc_param_slave/
- name: Build struct slave example
run: cmake --build ${{github.workspace}}/example/struc_param_slave/build --config ${{env.BUILD_TYPE}}
- name: copy Slave-Description to master build
run: cp ${{github.workspace}}/example/struc_param_master/StrucParam-Slave-Description.xml ${{github.workspace}}/example/struc_param_master/build/
- name: run struct example
run: ${{github.workspace}}/example/struc_param_slave/build/struc_param_slave & pid_slave=$! && cd ${{github.workspace}}/example/struc_param_master/build/ && ./struc_param_master && kill -KILL $pid_slave
- name: Configure CMake MSD master example
run: mkdir ${{github.workspace}}/example/spring_damper_master/build && cmake -B ${{github.workspace}}/example/spring_damper_master/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/example/spring_damper_master/
- name: Build MSD master example
run: cmake --build ${{github.workspace}}/example/spring_damper_master/build --config ${{env.BUILD_TYPE}}
- name: Configure CMake MSD1 slave example
run: mkdir ${{github.workspace}}/example/spring_damper_slave1/build && cmake -B ${{github.workspace}}/example/spring_damper_slave1/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/example/spring_damper_slave1/
- name: Build MSD1 slave example
run: cmake --build ${{github.workspace}}/example/spring_damper_slave1/build --config ${{env.BUILD_TYPE}}
- name: Configure CMake MSD2 slave example
run: mkdir ${{github.workspace}}/example/spring_damper_slave2/build && cmake -B ${{github.workspace}}/example/spring_damper_slave2/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/example/spring_damper_slave2/
- name: Build MSD2 slave example
run: cmake --build ${{github.workspace}}/example/spring_damper_slave2/build --config ${{env.BUILD_TYPE}}
- name: copy Slave-Description to master build
run: cp ${{github.workspace}}/example/spring_damper_master/MSD1-Slave-Description.xml ${{github.workspace}}/example/spring_damper_master/build/ && cp ${{github.workspace}}/example/spring_damper_master/MSD2-Slave-Description.xml ${{github.workspace}}/example/spring_damper_master/build/
- name: run MSD example
run: ${{github.workspace}}/example/spring_damper_slave1/build/dcp_msd1_slave & ${{github.workspace}}/example/spring_damper_slave2/build/dcp_msd2_slave & cd ${{github.workspace}}/example/spring_damper_master/build/ && ./dcp_msd_master && pkill dcp_msd1_slave && pkill dcp_msd2_slave