@@ -14,100 +14,79 @@ jobs:
14
14
setup :
15
15
runs-on : ubuntu-latest
16
16
17
- container :
17
+ container :
18
18
image : debian:bookworm
19
19
20
20
steps :
21
21
- name : Checkout repository
22
- uses : actions/checkout@v2
23
-
22
+ uses : actions/checkout@v4
23
+
24
24
- name : Update apt-get
25
25
run : apt-get update
26
26
27
27
- name : Install project dependencies
28
- run : DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git doxygen
28
+ run : DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git doxygen curl unzip
29
29
30
30
- name : Print GCC version
31
31
run : gcc --version
32
32
33
33
- name : Install CA certificates
34
34
run : apt-get install -y ca-certificates
35
35
36
- build :
36
+ build_test_and_analyse :
37
37
needs : setup
38
38
runs-on : ubuntu-latest
39
39
40
40
container :
41
41
image : debian:bookworm
42
-
42
+ env :
43
+ # https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
44
+ BUILD_WRAPPER_OUT_DIR : build_wrapper_output_directory # Directory where build-wrapper output will be placed
43
45
steps :
44
46
- name : Checkout repository
45
- uses : actions/checkout@v2
47
+ uses : actions/checkout@v4
46
48
47
49
- name : Update apt-get
48
50
run : apt-get update
49
51
50
52
- name : Install project dependencies
51
- run : DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git
52
-
53
- - name : Configure CMake
54
- run : cmake -S . -B build
55
-
56
- - name : Build with CMake
57
- run : cmake --build build || cat build/deps/src/ethash-stamp/ethash-configure-*.log
53
+ run : DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git curl unzip gcovr
58
54
59
- - name : Upload build artifacts
60
- uses : actions/upload-artifact@v2
61
- with :
62
- name : build
63
- path : build
55
+ - name : Install sonar-scanner and build-wrapper
56
+ uses : SonarSource/sonarcloud-github-c-cpp@v2
64
57
65
- test :
66
- needs : build
67
- runs-on : ubuntu-latest
58
+ - name : Configure CMake
59
+ run : cmake -S . -B build -DSONARQUBE_ANALYSIS=ON -DDEBUG=OFF
68
60
69
- container :
70
- image : debian:bookworm
61
+ - name : Build with SonarQube BuildWrapper + CMake
62
+ run : build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release -- -j $(nproc)
71
63
72
- steps :
73
- - name : Checkout repository
74
- uses : actions/checkout@v2
75
-
76
- - name : Download build artifacts
77
- uses : actions/download-artifact@v2
78
- with :
79
- name : build
80
- path : build
81
-
82
- - name : Update apt-get
83
- run : apt-get update
84
-
85
- - name : Install project dependencies
86
- run : DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake tmux clang-tidy autoconf libtool pkg-config libabsl-dev libboost-all-dev libc-ares-dev libcrypto++-dev libgrpc-dev libgrpc++-dev librocksdb-dev libscrypt-dev libsnappy-dev libssl-dev zlib1g-dev openssl protobuf-compiler protobuf-compiler-grpc libprotobuf-dev git
87
-
88
64
- name : Give execute permissions
89
65
run : chmod +x ./build/orbitersdkd-tests
90
66
91
67
- name : Run Catch2 Tests
92
- working-directory : build
93
- run : ./orbitersdkd-tests -d yes
68
+ run : ./build/orbitersdkd-tests -d yes
69
+
70
+ - name : Collect coverage into one XML report
71
+ run : |
72
+ gcovr --gcov-ignore-parse-errors --sonarqube > coverage.xml
94
73
74
+ - name : Run SonarQube Scanner
75
+ env :
76
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
77
+ SONAR_HOST_URL : ${{ secrets.SONAR_HOST_URL }}
78
+ run : |
79
+ sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.coverageReportPaths=coverage.xml
95
80
documentation :
96
- needs : test
81
+ needs : build_test_and_analyse
97
82
runs-on : ubuntu-latest
98
83
99
84
container :
100
85
image : debian:bookworm
101
86
102
87
steps :
103
88
- name : Checkout repository
104
- uses : actions/checkout@v2
105
-
106
- - name : Download build artifacts
107
- uses : actions/download-artifact@v2
108
- with :
109
- name : build
110
- path : build
89
+ uses : actions/checkout@v4
111
90
112
91
- name : Update apt-get
113
92
run : apt-get update
@@ -121,7 +100,7 @@ jobs:
121
100
doxygen Doxyfile
122
101
123
102
- name : Publish Documentation
124
- uses : actions/upload-artifact@v2
103
+ uses : actions/upload-artifact@v4
125
104
with :
126
105
name : Documentation
127
- path : docs
106
+ path : docs
0 commit comments