Skip to content

Commit

Permalink
WIP: Change: Ci: following guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
nichtsfrei committed Jan 17, 2024
1 parent daee772 commit e57c3e9
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 125 deletions.
1 change: 1 addition & 0 deletions .github/install-openvas-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ apt-get update && apt-get install --no-install-recommends --no-install-suggests
clang-tools \
cmake \
curl \
git \
lcov \
libgnutls28-dev \
libgpgme-dev \
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Build"

on:
push:
branches: [ main ]
pull_request:

jobs:
OpenVAS:
runs-on: ubuntu-latest
container: greenbone/gvm-libs:stable
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sh .github/install-openvas-dependencies.sh
- name: 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
OpenVAS_Daemon:
uses: ./.github/workflows/build-rust.yml
61 changes: 0 additions & 61 deletions .github/workflows/build_and_test.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Linting"

on:
push:
branches: [ main]
pull_request:

jobs:
OpenVAS:
runs-on: ubuntu-latest
container: greenbone/gvm-libs:stable
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
sh .github/install-openvas-dependencies.sh
- name: Formatting
run: |
clang-format --dry-run --Werror -i -style=file {src,misc,nasl}/*.{c,h}
- name: unit-tests
run: |
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build -- tests test
OpenVASd_Daemon:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- run: sudo apt update && sudo apt-get install -y libpcap-dev
- run: rustup update stable && rustup default stable || rustup default stable
- run: cargo install cargo-audit
- run: cargo install typos-cli
- name: unit-tests
run: cargo test --lib --tests --workspace
- run: cargo clippy -- -D warnings
- run: cargo audit
- run: typos
- run: cargo fmt --check
File renamed without changes.
Empty file.
Empty file added .github/workflows/push.yml
Empty file.
64 changes: 0 additions & 64 deletions .github/workflows/rustification.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,70 +9,6 @@ env:
CARGO_TERM_COLOR: always

jobs:
unittests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- uses: actions/checkout@v4
- run: sudo apt update && sudo apt-get install -y libpcap-dev
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} || rustup default ${{ matrix.toolchain }}
# Run unittests and integration test, but excludes the smoketest since it depends on a running openvasd server.
- run: cargo test --lib --tests --workspace --exclude smoketest
clippy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable && rustup component add clippy
- run: cargo clippy -- -D warnings
audit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo install cargo-audit
- run: cargo audit
typos:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
steps:
- uses: actions/checkout@v4
- run: rustup update stable && rustup default stable
- run: cargo install typos-cli
- run: typos
formatting:
runs-on: ubuntu-latest
defaults:
run:
working-directory: rust
strategy:
matrix:
crates:
# we verify each dir separately to make it easier to verify formatting issues or even ignore
# crates we deem not important for checking (e.g. feed-verifier)
- nasl-syntax
- storage
- nasl-interpreter
- redis-storage
- json-storage
- nasl-cli
steps:
- uses: actions/checkout@v4
rs-build-binaries:
uses: ./.github/workflows/build-rust.yml
verify-syntax:
Expand Down

0 comments on commit e57c3e9

Please sign in to comment.