-
Notifications
You must be signed in to change notification settings - Fork 5
189 lines (163 loc) · 4.99 KB
/
test.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
180
181
182
183
184
185
186
187
188
189
name: Linux and macOS Builds
on: [push, pull_request]
jobs:
TestC:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
images: ["debian:buster", "debian:bullseye", "ubuntu:20.04"]
include:
- images: "debian:buster"
label: "Debian_10"
- images: "debian:bullseye"
label: "Debian_11"
- images: "ubuntu:20.04"
label: "Ubuntu_20_04"
container:
image: ${{ matrix.images }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
bash ./.github/scripts/install_dependencies.sh
- name: Build and test
run: |
mkdir -p build
cd build
cmake -DBUILD_TESTS_EXAMPLES=ON ..
make -j4
make test ARGS="-VV"
cd ..
mkdir -p libs
cp build/bindings/c/src/libgenalyzer.so* libs/
cp build/src/libgenalyzer_plus_plus.a* libs/
cp bindings/c/include/cgenalyzer.h libs/
cp bindings/c/include/cgenalyzer_simplified_beta.h libs/
cp bindings/matlab/genalyzer.m libs/
- name: Archive generated SOs
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.label }}-Build
path: libs/
# TestCCentOS:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# images: ["tfcollins/libiio_centos_7-ci:latest"]
# container:
# image: ${{ matrix.images }}
# steps:
# - uses: actions/checkout@v4
# - name: Install dependencies
# run: |
# bash ./.github/scripts/install_dependencies_rhel.sh
# - name: Build and test
# run: |
# mkdir -p build
# cd build
# source scl_source enable devtoolset-7 && cmake -DBUILD_TESTS_EXAMPLES=ON ..
# make -j4
# make test ARGS="-VV"
# cd ..
# mkdir -p libs
# cp build/bindings/c/src/libgenalyzer.so* libs/
# cp build/src/libgenalyzer_plus_plus.a* libs/
# cp bindings/c/include/cgenalyzer.h libs/
# cp bindings/c/include/cgenalyzer_simplified_beta.h libs/
# cp bindings/matlab/genalyzer.m libs/
# - name: Archive generated SOs
# uses: actions/upload-artifact@v4
# with:
# name: RHEL_7-Build
# path: libs/
CoverageTest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.7
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Install dependencies
run: |
bash ./.github/scripts/install_dependencies.sh
sudo apt install lcov -y
- name: Build and run coverage test
run: |
mkdir -p build
cd build
cmake .. -DBUILD_TESTS_EXAMPLES=ON -DCOVERAGE=ON -DCMAKE_BUILD_TYPE=Debug
make -j4
make coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
path-to-lcov: build/main_coverage.info
TestCMacOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
brew install cmake gnu-tar bzip2 gzip fftw doxygen
pip3 install -r requirements_doc.txt
mkdir -p build
cd build
cmake -DBUILD_TESTS_EXAMPLES=ON ..
make -j4
make test ARGS="-VV"
sudo make install
TestPython:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
bash ./.github/scripts/install_dependencies.sh
bash ./.github/scripts/install_genalyzer.sh
pip install -r requirements_test.txt
- name: Test
run: |
cd bindings/python
pip install ".[tools]"
python -m pytest -vs tests
for f in examples/*.py; do python "$f"; done
Lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
bash ./.github/scripts/install_dependencies.sh
pip install -r requirements_test.txt
- name: Lint
run: |
pre-commit run --all-files 2> /dev/null
ec=$?
git diff -U0 > log.txt && cat log.txt
exit $ec