-
Notifications
You must be signed in to change notification settings - Fork 4
179 lines (153 loc) · 7.35 KB
/
ci_pulsed_power_monitoring.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: build_pulsed_power_monitoring
on:
push:
branches: ["*"]
pull_request:
branches: [main, develop]
release:
types: [created]
env:
REFERENCE_CONFIG: "Ubuntu Latest gcc" # configuration used for coverage etc
SRC_DIR_GR: "src/gr-pulsed_power"
SRC_DIR_WORKER: "src/opencmw_worker"
SRC_DIR_VIS: "src/implot_visualization"
jobs:
build:
name: "${{ matrix.configurations.name }} | ${{ matrix.cmake-build-type }}"
environment: configure coverage
runs-on: ${{ matrix.configurations.os }}
strategy:
fail-fast: false
matrix:
configurations:
- name: Ubuntu Latest gcc
os: ubuntu-22.04 # pre-release, ubuntu-latest still points to ubuntu-20.04
compiler: gcc
- name: Ubuntu Latest clang
os: ubuntu-22.04 # pre-release, ubuntu-latest still points to ubuntu-20.04
compiler: clang
# - name: MacOS Latest # deactivated because mp-units is not compatible with clangApple
# os: macos-latest
# - name: Windows Latest # deactivated because msvc fails because of clang pragmas
# os: windows-latest
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
cmake-build-type: [Release, Debug]
steps:
- uses: actions/checkout@v2
- name: Cache
uses: actions/cache@v2
env:
cache-name: cache-fetchContent-cache
with:
path: ${{runner.workspace}}/build/_deps
key: ${{ runner.os }}-${{ matrix.configurations.compiler }}-${{ matrix.cmake-build-type }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Dependencies.cmake') }}
- name: Install gcc-12
if: matrix.configurations.compiler == 'gcc'
run: |
sudo apt-get install -y gcc-12 g++-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 110 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
- name: Install clang-14
if: matrix.configurations.compiler == 'clang'
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-14 main'
sudo apt update
sudo apt install -y clang-14 libc++-14-dev libc++abi-14-dev
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-14 110
- name: Install gcovr
shell: bash
if: matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'
run: |
python3 -m pip install gcovr --user --no-warn-script-location
gcovr --version
# TENSORFLOW
- name: Install TensorFlow for C
shell: bash
run: |
FILENAME=libtensorflow-cpu-linux-x86_64-2.11.0.tar.gz
wget -q --no-check-certificate https://storage.googleapis.com/tensorflow/libtensorflow/${FILENAME}
sudo tar -C /usr/local -xzf ${FILENAME}
- name: Install cppflow
shell: bash
run: |
git clone --depth 1 --branch v2.0.0 https://github.com/serizba/cppflow
cd cppflow
cmake -S . -B build
cd build
make
sudo make install
# PICOSCOPE
- name: Install Picoscope dependencies
shell: bash
run: |
wget -qO- https://labs.picotech.com/debian/dists/picoscope/Release.gpg.key | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/picoscope.gpg
sudo bash -c 'echo "deb [signed-by=/etc/apt/trusted.gpg.d/picoscope.gpg] https://labs.picotech.com/debian/ picoscope main" >/etc/apt/sources.list.d/picoscope.list'
sudo apt update
sudo apt install picoscope
# GNU RADIO
- name: Install GNU Radio
shell: bash
run: |
sudo add-apt-repository ppa:gnuradio/gnuradio-releases
sudo apt-get update
- name: Install GNU Radio dependencies
shell: bash
run: sudo apt install xterm libsndfile1-dev libuhd-dev alsa-utils portaudio19-dev libuhd-dev libzmq3-dev libqwt-qt5-dev libiio-dev libad9361-dev libspdlog-dev libsoapysdr-dev libcodec2-dev
- name: GNU Radio - Configure pulsed-power out of tree modules
shell: bash
run: cmake -S ${{env.SRC_DIR_GR}} -B ${{env.SRC_DIR_GR}}/build -DCMAKE_BUILD_TYPE=${{matrix.cmake-build-type}}
- name: GNU Radio- Build pulsed-power out of tree modules
shell: bash
run: |
sudo cmake --build ${{env.SRC_DIR_GR}}/build --target install
sudo ldconfig
- name: GNU Radio - Test pulsed-power out of tree modules
if: matrix.cmake-build-type == 'Debug'
shell: bash
run: ctest --test-dir ${{env.SRC_DIR_GR}}/build
# OPENCMW
- name: Worker - Configure CMake
# Use a bash shell, so we can use the same syntax for environment variable access regardless of the host operating system
shell: bash
run: cmake -S ${{env.SRC_DIR_WORKER}} -B ${{env.SRC_DIR_WORKER}}/build -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }}
- name: Worker - Build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build ${{env.SRC_DIR_WORKER}}/build
- name: Worker - Run tests
if: matrix.configurations.name != env.REFERENCE_CONFIG || matrix.cmake-build-type == 'Debug'
working-directory: ${{env.SRC_DIR_WORKER}}/build
shell: bash
# Execute tests defined by the CMake configuration. The coverage target runs the autodiscovered catch2 tests using
# ctest and records the coverage using gcov
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ matrix.cmake-build-type }}
- name: Worker - Run tests with coverage
if: matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'
working-directory: ${{env.SRC_DIR_WORKER}}/build
shell: bash
# Execute tests defined by the CMake configuration. The coverage target runs the autodiscovered catch2 tests using
# ctest and records the coverage using gcov
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: cmake --build . --config ${{ matrix.cmake-build-type }} --target coverage
- uses: codecov/codecov-action@v2
if: matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'
with:
files: ${{env.SRC_DIR_WORKER}}/build/coverage.xml
- name: Worker - coverage report - send to Codacy
if: matrix.configurations.name == env.REFERENCE_CONFIG && matrix.cmake-build-type == 'Debug'
working-directory: ${{env.SRC_DIR_WORKER}}/build
shell: bash
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml --skip --project-token ${{ secrets.CODACY_PROJECT_TOKEN }}
# IMPLOT
- name: Dashboards - Install emscripten
uses: mymindstorm/setup-emsdk@v11
with:
version: 3.1.31
# actions-cache-folder: "emsdk-cache"
- name: Dashboards - Verify emscripten
run: emcc -v
- name: Dashboards - Configure CMake
run: emcmake cmake -S ${{env.SRC_DIR_VIS}} -B ${{env.SRC_DIR_VIS}}/build
- name: Dashboards - Build
run: cd ${{env.SRC_DIR_VIS}}/build && emmake make