-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (116 loc) · 4.9 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
name: CMake
defaults:
run:
shell: bash -ieo pipefail {0}
on:
push:
branches: [ master, alpha ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 0 * * 1'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
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: Installation
run: |
echo "Install dependencies of ZAF"
cd ${{github.workspace}}/../
git clone --depth 1 https://github.com/zzxx-husky/inst_scripts
./inst_scripts/install_zaf.sh --deps-only
cd ${{github.workspace}}
echo "Install Clang"
sudo apt install clang
clang --version
clang++ --version
- name: Configure CMake
# Configure CMake in a 'release' 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: |
source ${{github.workspace}}/../inst_scripts/instrc.sh
echo ${ZMQ_ROOT}
echo ${GTEST_ROOT}
echo ${GLOG_ROOT}
echo ${PHMAP_ROOT}
echo ${GPERF_ROOT}
cmake -S . -B ${{github.workspace}}/release -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/release -j4
- name: Test
working-directory: ${{github.workspace}}/release
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: timeout 10 ./tests/Tests
- name: Examples
working-directory: ${{github.workspace}}/release
run: |
echo "Run HelloWorld"
timeout 10 ./examples/HelloWorld && sleep 0.1
echo "Run HelloWorldX"
timeout 10 ./examples/HelloWorldX && sleep 0.1
echo "Run HelloWorldNetwork"
timeout 10 ./examples/HelloWorldNetwork && sleep 0.1
echo "Run HelloWorldByActorEngine"
timeout 10 ./examples/HelloWorldByActorEngine && sleep 0.1
echo "Run Shuffle"
timeout 20 ./examples/Shuffle && sleep 0.1
echo "Run ShuffleX"
timeout 20 ./examples/ShuffleX && sleep 0.1
echo "Run LoadRebalance"
timeout 20 ./examples/LoadRebalance && sleep 0.1
echo "Run ActorDelivery"
timeout 20 ./examples/ActorDelivery && sleep 0.1
- name: BuildMini
run: |
source ${{github.workspace}}/../inst_scripts/instrc.sh
cmake -S . -B ${{github.workspace}}/release_mini\
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}\
-DENABLE_TEST=OFF\
-DENABLE_PHMAP=OFF\
-DENABLE_TCMALLOC=OFF
cmake --build ${{github.workspace}}/release_mini -j4
cd ${{github.workspace}}/release_mini
echo "Run HelloWorld"
timeout 10 ./examples/HelloWorld && sleep 0.1
echo "Run HelloWorldX"
timeout 10 ./examples/HelloWorldX && sleep 0.1
echo "Run HelloWorldByActorEngine"
timeout 10 ./examples/HelloWorldByActorEngine && sleep 0.1
echo "Run HelloWorldNetwork"
timeout 10 ./examples/HelloWorldNetwork && sleep 0.1
- name: Gperftools Heap Profile
working-directory: ${{github.workspace}}/release
run: |
PPROF_PATH="$(which pprof)" HEAPCHECK=strict timeout 30 ./examples/HelloWorld && sleep 0.1
PPROF_PATH="$(which pprof)" HEAPCHECK=strict timeout 30 ./examples/HelloWorldX && sleep 0.1
PPROF_PATH="$(which pprof)" HEAPCHECK=strict timeout 30 ./examples/HelloWorldByActorEngine && sleep 0.1
PPROF_PATH="$(which pprof)" HEAPCHECK=strict timeout 30 ./examples/HelloWorldNetwork && sleep 0.1
- name: Compile with Clang
run: |
source ${{github.workspace}}/../inst_scripts/instrc.sh
cmake -S . -B ${{github.workspace}}/release_clang -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake --build ${{github.workspace}}/release_clang -j4
cd ${{github.workspace}}/release_clang
echo "Run HelloWorld"
timeout 10 ./examples/HelloWorld && sleep 0.1
echo "Run HelloWorldX"
timeout 10 ./examples/HelloWorldX && sleep 0.1
echo "Run HelloWorldByActorEngine"
timeout 10 ./examples/HelloWorldByActorEngine && sleep 0.1
echo "Run HelloWorldNetwork"
timeout 10 ./examples/HelloWorldNetwork && sleep 0.1
env:
CC: clang
CXX: clang++