-
Notifications
You must be signed in to change notification settings - Fork 634
61 lines (59 loc) · 1.92 KB
/
build_and_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
name: "openvas-c"
on:
push:
branches: [ main, stable ]
pull_request:
branches: [ main, stable ]
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Check out openvas-scanner
uses: actions/checkout@v4
- name: Check Source Format
run: |
clang-format -i -style=file {src,misc,nasl}/*.{c,h}
git diff --exit-code
compile:
runs-on: ubuntu-latest
strategy:
matrix:
# With the upcoming changes, we require both downwards and upwards compatibility between the OpenVAS C
# code and GVM-libs. This is because, even though we will be using semantic versioning, as long as
# OpenVAS and GVM-libs remain separate repositories, we want to be notified of every change.
gvm-libs-version:
- stable
- unstable
container: greenbone/gvm-libs:${{ matrix.gvm-libs-version }}
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sh .github/install-openvas-dependencies.sh
- name: Configure and Scan Build
run: |
cmake -Bbuild -DCMAKE_C_COMPILER=/usr/share/clang/scan-build-14/libexec/ccc-analyzer
scan-build -o ~/scan-build-report cmake --build build
- name: Upload scan-build report
uses: actions/upload-artifact@v3
with:
name: scan-build-report
path: ~/scan-build-report/
retention-days: 7
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
gvm-libs-version:
- stable
- unstable
container: greenbone/gvm-libs:${{ matrix.gvm-libs-version }}
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sh .github/install-openvas-dependencies.sh
- name: unit-tests
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build -- tests test