forked from greenbone/openvas-scanner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Change: Ci: following guidelines
- Loading branch information
1 parent
e2a5c9d
commit 688ec12
Showing
14 changed files
with
280 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main] | ||
tags: ["v*"] | ||
pull_request: | ||
workflow_dispatch: | ||
repository_dispatch: | ||
schedule: | ||
# rebuild image every sunday | ||
- cron: "0 0 * * 0" | ||
|
||
jobs: | ||
init: | ||
uses: ./.github/workflows/init.yaml | ||
build: | ||
uses: ./.github/workflows/build.yml | ||
linting: | ||
uses: ./.github/workflows/ci.yml | ||
container: | ||
needs: [build, init] | ||
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, init] | ||
uses: ./.github/workflows/smoketest.yaml |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Initialize | ||
|
||
on: [workflow_call] | ||
|
||
jobs: | ||
init: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
is_latest_tag: ${{ steps.version.outputs.is_latest_tag }} | ||
is_version_tag: ${{ steps.version.outputs.is_version_tag }} | ||
docker_tag: ${{ steps.version.output.docker_tag }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: "set IS_VERSION_TAG" | ||
run: | | ||
echo "IS_VERSION_TAG=${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}" >> $GITHUB_ENV | ||
# set defaults | ||
echo "IS_LATEST_TAG=false" >> $GITHUB_ENV | ||
- name: "set IS_LATEST_TAG" | ||
if: ( env.IS_VERSION_TAG == 'true' ) | ||
run: | | ||
# find the latest version that is not ourself | ||
export LATEST_VERSION=$(git tag -l | grep -v '${{ github.ref_name }}' | sort -r --version-sort) | ||
# get major minor patch versions | ||
IFS='.' read -r latest_major latest_minor latest_patch << EOF | ||
$LATEST_VERSION | ||
EOF | ||
IFS='.' read -r tag_major tag_minor tag_patch << EOF | ||
${{ github.ref_name }} | ||
EOF | ||
# remove leading v | ||
latest_major=$(echo $latest_major | cut -c2-) | ||
tag_major=$(echo $tag_major | cut -c2-) | ||
echo "$tag_major >= $latest_major" | ||
if [[ $tag_major -ge $latest_major && ($tag_minor -ne 0 || $tag_patch -ne 0) ]]; then | ||
# set this tag to latest and stable | ||
echo "IS_LATEST_TAG=true" >> $GITHUB_ENV | ||
fi | ||
echo "VERSION=$tag_major.$tag_minor.$tag_patch" >> $GITHUB_ENV | ||
- name: "set DOCKER_TAG = edge" | ||
if: ( env.IS_VERSION_TAG != 'true' ) | ||
run: | | ||
echo "DOCKER_TAG=edge" >> $GITHUB_ENV | ||
- name: "set DOCKER_TAG = ${{ env.VERSION }}" | ||
if: ( env.IS_VERSION_TAG == 'true' ) | ||
run: | | ||
echo "DOCKER_TAG=$VERSION" >> $GITHUB_ENV | ||
- name: set output | ||
id: version | ||
run: | | ||
echo "is_latest_tag=$IS_LATEST_TAG" >> "$GITHUB_OUTPUT" | ||
echo "is_version_tag=$IS_VERSION_TAG" >> "$GITHUB_OUTPUT" | ||
echo "docker_tag=$DOCKER_TAG" >> "$GITHUB_OUTPUT" |
This file was deleted.
Oops, something went wrong.
41 changes: 4 additions & 37 deletions
41
.github/workflows/container.yml → .github/workflows/push-container.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.