6
6
BUILD_TYPE : Debug
7
7
8
8
jobs :
9
+
10
+ # # BUILD JOBS
9
11
build :
10
12
strategy :
11
13
matrix :
12
14
db : [postgresql, sqlite3]
13
- os : [ubuntu-20.04, ubuntu-18.04 ]
15
+ os : [ubuntu-20.04]
14
16
fail-fast : false
15
17
16
18
runs-on : ${{ matrix.os }}
17
19
18
- # Service containers to run with `runner-job`
19
20
services :
20
21
# Label used to access the service container
21
22
postgres :
22
- # Docker Hub image
23
23
image : postgres
24
24
# Provide the password for postgres
25
25
env :
@@ -35,113 +35,17 @@ jobs:
35
35
- 5432:5432
36
36
37
37
steps :
38
- - uses : actions/checkout@v2
38
+ - uses : actions/checkout@v3
39
39
40
40
- name : Update apt-get
41
41
run : sudo apt-get update
42
42
43
- # Ubuntu 18.04 commands
44
- - name : Install required packages Ubuntu 18
45
- if : ${{ matrix.os == 'ubuntu-18.04' }}
46
- run : >
47
- sudo apt-get install -y git cmake make g++ gcc-7-plugin-dev libboost-all-dev
48
- llvm-10-dev clang-10 libclang-10-dev default-jdk libssl1.0-dev libgraphviz-dev
49
- libmagic-dev libgit2-dev ctags doxygen libgtest-dev npm libldap2-dev
50
-
51
- - name : Remove default Postgresql Ubuntu 18
52
- if : ${{ matrix.os == 'ubuntu-18.04' && matrix.db == 'postgresql' }}
53
- run : sudo apt-get remove libpq5
54
-
55
- - name : Install Postgresql Ubuntu 18
56
- if : ${{ matrix.os == 'ubuntu-18.04' && matrix.db == 'postgresql' }}
57
- run : sudo apt-get install postgresql-server-dev-10
58
-
59
- - name : Install SQLite3 Ubuntu 18
60
- if : ${{ matrix.os == 'ubuntu-18.04' && matrix.db == 'sqlite3' }}
61
- run : sudo apt-get install libsqlite3-dev
62
-
63
- - name : Cache Thrift Ubuntu 18
64
- id : thrift-cache
65
- if : ${{ matrix.os == 'ubuntu-18.04' }}
66
- uses : actions/cache@v2
67
- with :
68
- path : ~/thrift_install
69
- key : ${{ matrix.db }}-thrift-v2
70
-
71
- - name : Install Thrift
72
- if : ${{ matrix.os == 'ubuntu-18.04' && steps.thrift-cache.outputs.cache-hit != 'true' }}
73
- run : >
74
- cd $HOME
75
-
76
- wget -O thrift-0.13.0.tar.gz
77
- "http://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=thrift/0.13.0/thrift-0.13.0.tar.gz"
78
-
79
- tar -xvf ./thrift-0.13.0.tar.gz
80
-
81
- cd thrift-0.13.0
43
+ - name : Install required packages for build
44
+ run : ./.github/scripts/setup_build_${{matrix.os}}.sh
82
45
83
- ./configure --prefix=$HOME/thrift_install --without-python --enable-libtool-lock
84
- --enable-tutorial=no --enable-tests=no --with-libevent --with-zlib --without-nodejs
85
- --without-lua --without-ruby --without-csharp --without-erlang --without-perl
86
- --without-php --without-php_extension --without-dart --without-haskell --without-go
87
- --without-rs --without-haxe --without-dotnetcore --without-d --without-qt4 --without-qt5
88
- --without-java --without-swift
46
+ - name : Install database packages
47
+ run : ./.github/scripts/setup_${{matrix.db}}_${{matrix.os}}.sh
89
48
90
- make install -j $(nproc)
91
-
92
- - name : Cache ODB Ubuntu 18
93
- id : odb-cache
94
- if : ${{ matrix.os == 'ubuntu-18.04' }}
95
- uses : actions/cache@v2
96
- with :
97
- path : ~/odb_install
98
- key : ${{ matrix.db }}-odb-v2
99
-
100
- - name : Install ODB
101
- if : ${{ matrix.os == 'ubuntu-18.04' && steps.odb-cache.outputs.cache-hit != 'true' }}
102
- run : |
103
- cd $HOME
104
- mkdir /tmp/build2src
105
- cd /tmp/build2src
106
- curl -sSfO https://download.build2.org/0.15.0/build2-install-0.15.0.sh
107
- sh build2-install-0.15.0.sh --yes --trust yes "$HOME/build2_install/"
108
- export PATH=$PATH:$HOME/build2_install/bin/
109
- mkdir /tmp/odb_build
110
- cd /tmp/odb_build
111
- bpkg create --quiet --jobs $(nproc) cc config.cxx=g++ config.cc.coptions=-O3 config.bin.rpath="$HOME/odb_install/lib" config.install.root="$HOME/odb_install" config.install.sudo=sudo
112
- bpkg add https://pkg.cppget.org/1/beta --trust-yes
113
- bpkg fetch --trust-yes
114
- bpkg build odb --yes
115
- bpkg build libodb --yes
116
- bpkg build libodb-sqlite --yes
117
- bpkg build libodb-pgsql --yes
118
- bpkg install --all --recursive
119
-
120
- - name : Export environment variables Ubuntu 18
121
- if : ${{ matrix.os == 'ubuntu-18.04' }}
122
- run : |
123
- ls $HOME/odb_install/bin
124
- ls $HOME/thrift_install/bin
125
- echo "CMAKE_PREFIX_PATH=$HOME/thrift_install:$HOME/odb_install:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
126
- echo "PATH=$HOME/thrift_install/bin:$HOME/odb_install/bin:$PATH" >> $GITHUB_ENV
127
-
128
- # Ubuntu 20.04 commands
129
- - name : Install required packages Ubuntu 20
130
- if : ${{ matrix.os == 'ubuntu-20.04' }}
131
- run : >
132
- sudo apt-get install -y git cmake make g++ libboost-all-dev llvm-10-dev clang-10
133
- libclang-10-dev odb libodb-dev thrift-compiler libthrift-dev default-jdk libssl-dev
134
- libgraphviz-dev libmagic-dev libgit2-dev ctags doxygen libgtest-dev npm libldap2-dev
135
-
136
- - name : Install Postgresql Ubuntu 20
137
- if : ${{ matrix.os == 'ubuntu-20.04' && matrix.db == 'postgresql' }}
138
- run : sudo apt-get install libodb-pgsql-dev postgresql-server-dev-12
139
-
140
- - name : Install SQLite3 Ubuntu 20
141
- if : ${{ matrix.os == 'ubuntu-20.04' && matrix.db == 'sqlite3' }}
142
- run : sudo apt-get install libodb-sqlite-dev libsqlite3-dev
143
-
144
- # Common commands
145
49
- name : Install GoogleTest
146
50
run : |
147
51
echo $PATH
@@ -216,6 +120,8 @@ jobs:
216
120
name : codecompass-${{ matrix.os }}-${{ matrix.db }}-compiletime
217
121
path : ${{github.workspace}}/artifacts/codecompass-${{ matrix.os }}-${{ matrix.db }}-compiletime.zip
218
122
123
+
124
+ # # PARSING JOBS
219
125
parse :
220
126
needs : build
221
127
strategy :
@@ -226,11 +132,9 @@ jobs:
226
132
227
133
runs-on : ${{ matrix.os }}
228
134
229
- # Service containers to run with `runner-job`
230
135
services :
231
136
# Label used to access the service container
232
137
postgres :
233
- # Docker Hub image
234
138
image : postgres
235
139
# Provide the password for postgres
236
140
env :
@@ -247,73 +151,17 @@ jobs:
247
151
- 5432:5432
248
152
249
153
steps :
250
- - uses : actions/checkout@v2
154
+ - uses : actions/checkout@v3
251
155
252
156
- name : Update apt-get
253
157
run : sudo apt-get update
254
158
255
- # Ubuntu 18.04 commands
256
- - name : Install required packages Ubuntu 18
257
- if : ${{ matrix.os == 'ubuntu-18.04' }}
258
- run : >
259
- sudo apt-get install -y git cmake make g++ gcc-7-plugin-dev libgraphviz-dev
260
- libboost-filesystem-dev libboost-log-dev libboost-program-options-dev
261
- llvm-10-dev clang-10 libclang-10-dev default-jre libssl1.0-dev libmagic-dev
262
- libgit2-dev ctags libgtest-dev libldap-2.4-2
263
-
264
- - name : Remove default Postgresql Ubuntu 18
265
- if : ${{ matrix.os == 'ubuntu-18.04' && matrix.db == 'postgresql' }}
266
- run : sudo apt-get remove libpq5
267
-
268
- - name : Install Postgresql Ubuntu 18
269
- if : ${{ matrix.os == 'ubuntu-18.04' && matrix.db == 'postgresql' }}
270
- run : sudo apt-get install postgresql-server-dev-10
271
-
272
- - name : Install SQLite3 Ubuntu 18
273
- if : ${{ matrix.os == 'ubuntu-18.04' && matrix.db == 'sqlite3' }}
274
- run : sudo apt-get install libsqlite3-dev
275
-
276
- - name : Cache ODB Ubuntu 18
277
- id : odb-cache
278
- if : ${{ matrix.os == 'ubuntu-18.04' }}
279
- uses : actions/cache@v2
280
- with :
281
- path : ~/odb_install
282
- key : ${{ matrix.db }}-odb-v2
283
-
284
- - name : Cache Thrift Ubuntu 18
285
- id : thrift-cache
286
- if : ${{ matrix.os == 'ubuntu-18.04' }}
287
- uses : actions/cache@v2
288
- with :
289
- path : ~/thrift_install
290
- key : ${{ matrix.db }}-thrift-v2
291
-
292
- - name : Export environment variables Ubuntu 18
293
- if : ${{ matrix.os == 'ubuntu-18.04' }}
294
- run : |
295
- echo "LD_LIBRARY_PATH=$HOME/thrift_install/lib:$HOME/odb_install/lib:$CMAKE_PREFIX_PATH" >> $GITHUB_ENV
296
- echo "PATH=$HOME/thrift_install/bin:$HOME/odb_install/bin:$PATH" >> $GITHUB_ENV
297
-
298
- # Ubuntu 20.04 commands
299
- - name : Install required packages Ubuntu 20
300
- if : ${{ matrix.os == 'ubuntu-20.04' }}
301
- run : >
302
- sudo apt-get install -y git cmake make g++ libboost-filesystem-dev
303
- libboost-log-dev libboost-program-options-dev llvm-10-dev clang-10
304
- libclang-10-dev libgraphviz-dev libgtest-dev odb libodb-dev
305
- libthrift-dev default-jre libssl1.1 libmagic-dev libgit2-dev ctags
306
- libldap-2.4-2
307
-
308
- - name : Install Postgresql Ubuntu 20
309
- if : ${{ matrix.os == 'ubuntu-20.04' && matrix.db == 'postgresql' }}
310
- run : sudo apt-get install libodb-pgsql-dev postgresql-server-dev-12
159
+ - name : Install required packages for runtime
160
+ run : ./.github/scripts/setup_runtime_${{matrix.os}}.sh
311
161
312
- - name : Install SQLite3 Ubuntu 20
313
- if : ${{ matrix.os == 'ubuntu-20.04' && matrix.db == 'sqlite3' }}
314
- run : sudo apt-get install libodb-sqlite-dev libsqlite3-dev
162
+ - name : Install database packages
163
+ run : ./.github/scripts/setup_${{matrix.db}}_${{matrix.os}}.sh
315
164
316
- # Common commands
317
165
- name : Download CodeCompass binaries
318
166
uses : actions/download-artifact@v2
319
167
with :
@@ -405,70 +253,26 @@ jobs:
405
253
cd ${{github.workspace}}/install/bin
406
254
./CodeCompass_parser -d "sqlite:database=$HOME/xerces.sqlite" -w $HOME/ws_pgsql/ -n "Xerces-C" -i $HOME/xerces-c -i $HOME/build_xerces-c/compile_commands.json -j $(nproc)
407
255
256
+
257
+ # # DOCKER IMAGE JOB
408
258
docker :
409
259
needs : parse
410
260
if : ${{ github.repository == 'Ericsson/CodeCompass' && (github.ref_name == 'master' || startsWith(github.ref_name, 'release/') == true) }}
411
- runs-on : ubuntu-20.04
412
261
262
+ runs-on : ubuntu-20.04
413
263
steps :
414
- - name : Checkout
415
- uses : actions/checkout@v2
416
-
417
- - name : Branch name slug
418
- uses : rlespinasse/github-slug-action@v4
419
-
420
- - name : Branch name substring
421
-
422
- id : branch_substring
264
+ - name : Build Docker images
265
+ uses : ./.github/workflows/docker.yml
423
266
with :
424
- value : ${{ env.GITHUB_REF_SLUG }}
425
- index_of_str : " release-"
426
- fail_if_not_found : false
427
- default_return_value : " "
267
+ tag-latest : ${{ github.ref_name == 'master' }}
428
268
429
- - name : Build images
430
- run : |
431
- BRANCH_PREFIX=${{ steps.branch_substring.outputs.substring }}
432
- BRANCH_PREFIX=${BRANCH_PREFIX}${BRANCH_PREFIX:+-} # append dash if not empty
433
- docker build -t codecompass:dev -t modelcpp/codecompass:${BRANCH_PREFIX}dev --file docker/dev/Dockerfile .
434
- docker build -t codecompass:runtime -t modelcpp/codecompass:${BRANCH_PREFIX}runtime-sqlite --file docker/runtime/Dockerfile --no-cache --build-arg CC_DATABASE=sqlite .
435
- docker build -t codecompass:web -t modelcpp/codecompass:${BRANCH_PREFIX}web-sqlite --file docker/web/Dockerfile --no-cache .
436
- docker build -t codecompass:runtime -t modelcpp/codecompass:${BRANCH_PREFIX}runtime-pgsql --file docker/runtime/Dockerfile --no-cache --build-arg CC_DATABASE=pgsql .
437
- docker build -t codecompass:web -t modelcpp/codecompass:${BRANCH_PREFIX}web-pgsql --file docker/web/Dockerfile --no-cache .
438
-
439
- - name : Login to DockerHub
440
- uses : docker/login-action@v2
441
- with :
442
- username : ${{ secrets.DOCKERHUB_USERNAME }}
443
- password : ${{ secrets.DOCKERHUB_TOKEN }}
444
-
445
- - name : Push images
446
- run : |
447
- BRANCH_PREFIX=${{ steps.branch_substring.outputs.substring }}
448
- BRANCH_PREFIX=${BRANCH_PREFIX}${BRANCH_PREFIX:+-} # append dash if not empty
449
- docker push modelcpp/codecompass:${BRANCH_PREFIX}dev
450
- docker push modelcpp/codecompass:${BRANCH_PREFIX}runtime-sqlite
451
- docker push modelcpp/codecompass:${BRANCH_PREFIX}runtime-pgsql
452
- docker push modelcpp/codecompass:${BRANCH_PREFIX}web-sqlite
453
- docker push modelcpp/codecompass:${BRANCH_PREFIX}web-pgsql
454
-
455
- - name : Tag and push latest image
456
- if : ${{ github.ref_name == 'master' }}
457
- run : |
458
- docker tag modelcpp/codecompass:runtime-pgsql modelcpp/codecompass:latest
459
- docker push modelcpp/codecompass:latest
460
269
270
+ # # TARBALL JOB
461
271
tarball :
462
272
needs : parse
463
273
if : ${{ github.repository == 'Ericsson/CodeCompass' && (github.ref_name == 'master' || startsWith(github.ref_name, 'release/') == true) }}
464
- runs-on : ubuntu-20.04
465
274
275
+ runs-on : ubuntu-20.04
466
276
steps :
467
- - name : Update apt-get
468
- run : sudo apt-get update
469
-
470
- - name : Install curl
471
- run : sudo apt-get install curl
472
-
473
- - name : Trigger GitLab CI
474
- run : curl -X POST -F token=${{ secrets.GITLAB_TRIGGER_TOKEN }} -F ref=${{ github.ref_name }} https://gitlab.inf.elte.hu/api/v4/projects/85/trigger/pipeline
277
+ - name : Create Tarball
278
+ uses : ./.github/workflows/tarball.yml
0 commit comments