Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor ci #1556

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 1 addition & 17 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
name: Build Container

on:
push:
branches: [ main, stable, oldstable, middleware ]
tags: ["v*"]
paths:
- .github/workflows/build-container.yml
- .docker/build.Dockerfile
pull_request:
branches: [ main, stable, oldstable, middleware ]
paths:
- .github/workflows/build-container.yml
- .docker/build.Dockerfile
workflow_dispatch:
repository_dispatch:
schedule:
# rebuild image every sunday
- cron: "0 0 * * 0"
on: [workflow_call]

jobs:
build:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Build"

on: [workflow_call]

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: [workflow_call]

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
OpenVAS_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
- name: Clippy
run: cargo clippy -- -D warnings
- name: Audit
run: cargo audit
- run: typos
- name: Formatting
run: cargo fmt --check
26 changes: 26 additions & 0 deletions .github/workflows/control.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches: [ main]
tags: ["v*"]
pull_request:
workflow_dispatch:
repository_dispatch:
schedule:
# rebuild image every sunday
- cron: "0 0 * * 0"

jobs:
build:
uses: ./.github/workflows/build.yml
linting:
uses: ./.github/workflows/ci.yml
container:
needs: [build]
uses: ./.github/workflows/push-container.yml
# although it seems a bit odd, but that way we ensure
# that we test the latest greatest thing.
smoketests:
needs: [container]
uses: ./.github/workflows/smoketest.yaml
Empty file.
41 changes: 0 additions & 41 deletions .github/workflows/nasl.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
name: Container

on:
push:
branches: [main, stable, oldstable, middleware]
tags: ["v*"]
pull_request:
branches: [main, stable, oldstable, middleware]
workflow_dispatch:
repository_dispatch:
on: [workflow_call]

jobs:
rs-build-binaries:
uses: ./.github/workflows/build-rust.yml

production-image:
runs-on: ubuntu-latest
needs: [rs-build-binaries]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/push-helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Helm Push"

on: [workflow_call]

jobs:
helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: greenbone/actions/helm-build-push@v3
if: github.event_name == 'workflow_dispatch'
with:
chart-name: openvasd
registry: ${{ vars.IMAGE_REGISTRY }}
registry-subpath: helm-charts/
registry-user: ${{ secrets.GREENBONE_BOT }}
registry-token: ${{ secrets.GREENBONE_BOT_PACKAGES_WRITE_TOKEN }}
124 changes: 0 additions & 124 deletions .github/workflows/rustification.yaml

This file was deleted.

Loading
Loading