-
Notifications
You must be signed in to change notification settings - Fork 6
274 lines (234 loc) · 7.85 KB
/
ci.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
name: CI
on:
push:
branches: [ '**' ]
tags: [ '**' ]
pull_request:
branches: [ '**' ]
jobs:
## Debug Build Job
debug:
name: Debug Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Prerequisites (Ubuntu)
run: |
export PATH="$HOME/.local/bin:$PATH"
pip3 install --upgrade pip
sudo pip3 install cpplint
sudo apt-get update
sudo apt-get install -y cppcheck doxygen liblzma-dev libzstd-dev libbz2-dev
- name: Install HTSLib
run: |
git clone https://github.com/samtools/htslib.git
cd htslib
git checkout tags/1.21
git submodule update --init --recursive
autoreconf -i
./configure
make -j
sudo make install
- name: Install LibBSC
run: |
git clone https://github.com/IlyaGrebnov/libbsc.git
cd libbsc
git checkout tags/v3.3.4
sed -i 's/clang++/g++/g' makefile
make -j
sudo make install
- name: Run Source Code Tests
run: ./ci/src_test.sh
- name: Build Documentation
run: ./ci/build.sh doc
- name: Build Genie (Debug)
run: ./ci/build.sh debug
- name: Upload Debug Binaries
uses: actions/upload-artifact@v4
with:
name: genie-debug-ubuntu2404-${{ github.sha }}
path: cmake-build-debug/bin
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: genie-documentation-${{ github.sha }}
path: cmake-build-debug/documentation/html
## Release Build Job
release:
name: Release Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Prerequisites (Ubuntu)
run: |
export PATH="$HOME/.local/bin:$PATH"
pip3 install --upgrade pip
sudo pip3 install cpplint
sudo apt-get update
sudo apt-get install -y cppcheck doxygen liblzma-dev libzstd-dev libbz2-dev
- name: Install HTSLib
run: |
git clone https://github.com/samtools/htslib.git
cd htslib
git checkout tags/1.21
git submodule update --init --recursive
autoreconf -i
./configure
make -j
sudo make install
- name: Install LibBSC
run: |
git clone https://github.com/IlyaGrebnov/libbsc.git
cd libbsc
git checkout tags/v3.3.4
sed -i 's/clang++/g++/g' makefile
make -j
sudo make install
- name: Build Genie (Release)
run: ./ci/build.sh release
- name: Upload Release Binaries
uses: actions/upload-artifact@v4
with:
name: genie-release-ubuntu2404-${{ github.sha }}
path: cmake-build-release/bin
## Unit Tests Job
unit:
name: Unit Tests
runs-on: ubuntu-latest
needs: debug
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Prerequisites (Ubuntu)
run: |
export PATH="$HOME/.local/bin:$PATH"
pip3 install --upgrade pip
sudo pip3 install cpplint
sudo apt-get update
sudo apt-get install -y cppcheck doxygen liblzma-dev libzstd-dev libbz2-dev
- name: Install HTSLib
run: |
git clone https://github.com/samtools/htslib.git
cd htslib
git checkout tags/1.21
git submodule update --init --recursive
autoreconf -i
./configure
make -j
sudo make install
- name: Download Debug Binaries
uses: actions/download-artifact@v4
with:
name: genie-debug-ubuntu2404-${{ github.sha }}
path: cmake-build-debug/bin
- name: Make Debug Binaries Executable
run: chmod +x cmake-build-debug/bin/*
- name: Run Unit Tests
run: ci/unit_test.sh
- name: Upload Utils Test Results
uses: actions/upload-artifact@v4
with:
name: utils-ubuntu2404-${{ github.sha }}
path: cmake-build-debug/bin/utils_test.xml
- name: Upload Coding Test Results
uses: actions/upload-artifact@v4
with:
name: coding-ubuntu2404-${{ github.sha }}
path: cmake-build-debug/bin/coding_test.xml
- name: Upload Gabac Test Results
uses: actions/upload-artifact@v4
with:
name: gabac-ubuntu2404-${{ github.sha }}
path: cmake-build-debug/bin/gabac_test.xml
## Conformance Roundtrip Tests Job
conformance_roundtrip:
name: Conformance Roundtrip Tests
runs-on: ubuntu-latest
needs: release
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Prerequisites (Ubuntu)
run: |
export PATH="$HOME/.local/bin:$PATH"
pip3 install --upgrade pip
sudo pip3 install cpplint
sudo apt-get update
sudo apt-get install -y cppcheck doxygen liblzma-dev libzstd-dev libbz2-dev
- name: Install HTSLib
run: |
git clone https://github.com/samtools/htslib.git
cd htslib
git checkout tags/1.21
git submodule update --init --recursive
autoreconf -i
./configure
make -j
sudo make install
- name: Checkout Reference Decoder
run: |
mkdir ref-decoder
cd ref-decoder
git config --global init.defaultBranch master
git config --global pull.ff only
git init
git config user.email "mitogen-group@gmail.com"
git config user.name "Azure test script"
git pull https://${{ secrets.EPFL_SCI_STI_MM_GITLAB_USERNAME }}:${{ secrets.EPFL_SCI_STI_MM_GITLAB_PASSWORD }}@git.mpeg.expert/MPEG/Genomic_Information_Representation/mpegg-reference-sw.git Fix_LA
- name: Configure Reference Decoder (CMake)
run: |
cd ref-decoder
sed -i '/set (CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")/s/^/#/' CMakeLists.txt
cmake .
- name: Build Reference Decoder
run: |
cd ref-decoder
make --jobs
- name: Download Release Binaries
uses: actions/download-artifact@v4
with:
name: genie-release-ubuntu2404-${{ github.sha }}
path: cmake-build-release/bin
- name: Make Release Binaries Executable
run: chmod +x cmake-build-release/bin/*
- name: Run Conformance Tests
run: MPEGG_REF_DECODER=$PWD/ref-decoder/bin/decoder/mpegg-decoder-p2 ci/conformance_test.sh
## Docker Build and Push Job
docker:
name: Docker Build and Push
runs-on: ubuntu-latest
needs: [ unit, conformance_roundtrip ]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Push Docker Image (develop branch)
if: github.ref == 'refs/heads/develop'
uses: docker/build-push-action@v3
with:
context: .
file: '**/Dockerfile'
push: true
tags: muefab/genie:develop
- name: Build and Push Docker Image (main branch)
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v3
with:
context: .
file: '**/Dockerfile'
push: true
tags: muefab/genie:latest
- name: Build and Push Docker Image (Git tag)
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@v3
with:
context: .
file: '**/Dockerfile'
push: true
tags: muefab/genie:${{ github.ref_name }}