-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (128 loc) · 3.85 KB
/
build.yaml
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Build and Test Nymph
on:
pull_request:
push:
branches: [main, develop]
tags: ['*']
env:
Nymph_BUILD_NYMPH_EXE: ON
Nymph_ENABLE_EXECUTABLES: ON
Nymph_ENABLE_PYTHON: OFF
Nymph_ENABLE_TESTING: ON
Nymph_SINGLETHREADED: OFF
Nymph_BUILD_TYPE: Debug
Nymph_TAG: test
jobs:
docker_build:
name: Build and Test in Docker
runs-on: ubuntu-20.04
steps:
- name: Checkout the repo
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build and test
run: |
docker build \
--target nymph_done \
--build-arg img_repo=${BASE_IMAGE_REPO} \
--build-arg img_tag=${BASE_IMAGE_TAG} \
--build-arg build_type=${Nymph_BUILD_TYPE} \
--build-arg build_tests_exe=${Nymph_ENABLE_TESTING} \
--build-arg nymph_tag=${Nymph_TAG} \
--tag project8/nymph:${Nymph_TAG} \
.
docker run project8/nymph:${Nymph_TAG} /tmp_source/build/Testing/RunTests
build_cpp:
name: Build and Test Cpp
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-10.15]
python-version: [3.9]
steps:
- name: Checkout repository
uses: actions/checkout@master
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Mac Dependencies
if: startsWith(matrix.os, 'macos') # Mac only
run: |
brew install \
boost \
rapidjson \
yaml-cpp \
pybind11
- name: Linux Dependencies
if: startsWith(matrix.os, 'ubuntu') # Linux only
run: |
sudo apt-get update
sudo apt-get install -yq \
libboost-all-dev \
libyaml-cpp-dev \
rapidjson-dev \
pybind11-dev
pip install "pybind11[global]"
- name: Configure CMake
run: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=${Nymph_BUILD_TYPE} -DNymph_BUILD_NYMPH_EXE=${Nymph_BUILD_NYMPH_EXE} -DNymph_ENABLE_EXECUTABLES=${Nymph_ENABLE_EXECUTABLES} -DNymph_ENABLE_PYTHON=${Nymph_ENABLE_PYTHON} -DNymph_ENABLE_TESTING=${Nymph_ENABLE_TESTING} -DNymph_SINGLETHREADED=${Nymph_SINGLETHREADED} ..
- name: CMake Build
run: |
cd build
make -j install
- name: Run tests
run: |
cd build
Testing/RunTests
build_python:
name: Build and Test Python
runs-on: ${{ matrix.os }}
env:
Nymph_ENABLE_PYTHON: ON
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-10.15]
python-version: [3.9]
steps:
- name: Checkout repository
uses: actions/checkout@master
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Mac Dependencies
if: startsWith(matrix.os, 'macos') # Mac only
run: |
brew install \
boost \
rapidjson \
yaml-cpp \
pybind11
python -m pip install build
- name: Linux Dependencies
if: startsWith(matrix.os, 'ubuntu') # Linux only
run: |
sudo apt-get update
sudo apt-get install -yq \
libboost-all-dev \
libyaml-cpp-dev \
rapidjson-dev
pip install "pybind11[global]"
python -m pip install build
- name: Install nymph
run: |
pip -v install .
- name: Run Tests
run: |
cd Testing/Python
python -m unittest discover -v