From 80caf48fd0009c80e94ac8b62a8470dd038a4e5d Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Thu, 26 Sep 2024 12:57:39 +0200 Subject: [PATCH 01/26] Replace container.yml with push.yml --- .github/workflows/container.yml | 84 --------------------------------- .github/workflows/push.yml | 26 ++++++++++ 2 files changed, 26 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/container.yml create mode 100644 .github/workflows/push.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml deleted file mode 100644 index d033d74..0000000 --- a/.github/workflows/container.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Container Image Builds - -on: - push: - branches: [main] - tags: ["v*"] - pull_request: - branches: [main] - workflow_dispatch: - -jobs: - production: - name: Production Images - runs-on: ubuntu-latest - steps: - - name: Checkout repository - 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 ) - 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 - - name: 'Setup meta information (IS_VERSION_TAG: ${{ env.IS_VERSION_TAG }}, IS_LATEST_TAG: ${{ env.IS_LATEST_TAG }} )' - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ github.repository }} - labels: | - org.opencontainers.image.vendor=Greenbone - org.opencontainers.image.base.name=debian:stable-slim - flavor: latest=false # no auto latest container tag for git tags - tags: | - # when IS_LATEST_TAG is set create a stable and a latest tag - type=raw,value=latest,enable=${{ env.IS_LATEST_TAG }} - type=raw,value=stable,enable=${{ env.IS_LATEST_TAG }} - # if tag version is set than create a version tags - type=semver,pattern={{version}},enable=${{ env.IS_VERSION_TAG }} - type=semver,pattern={{major}}.{{minor}},enable=${{ env.IS_VERSION_TAG }} - type=semver,pattern={{major}},enable=${{ env.IS_VERSION_TAG }} - # if we are on the main branch set edge - type=edge,branch=main - # use branch-sha otherwise for pushes to branches other then main (will not be uploaded) - type=raw,value={{branch}}-{{sha}},enable=${{ github.ref_type == 'branch' && github.event_name == 'push' && github.ref_name != 'main' }} - # use pr-$PR_ID for pull requests (will not be uploaded) - type=ref,event=pr - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Registry - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push Container image - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ github.event_name != 'pull_request' && (github.ref_type == 'tag' || github.ref_name == 'main') }} - file: .docker/prod.Dockerfile - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..14666fd --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,26 @@ +name: Build & Push to Greenbone Registry + +on: + push: + branches: [ main ] + tags: ["v*"] + pull_request: + branches: [ main ] + workflow_dispatch: + inputs: + ref-name: + type: string + description: "The ref to build a container image from. For example a tag v23.0.0." + required: true + +jobs: + build-push-debian-stable-container: + name: Build and Push debian:stable to Greenbone Registry + uses: greenbone/workflows/.github/workflows/container-build-push-2nd-gen.yml@main + with: + image-url: community/boreas + image-labels: | + org.opencontainers.image.vendor=Greenbone + org.opencontainers.image.base.name=debian:stable-slim + ref-name: ${{ inputs.ref-name }} + secrets: inherit From 8f097ede9747701a494e403ea3a66299d9dd06c0 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Thu, 26 Sep 2024 13:01:01 +0200 Subject: [PATCH 02/26] Change: Remove whitespaces --- .github/workflows/codeql.yml | 2 +- .github/workflows/release.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index bcddf14..a442f65 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: language: [ 'c' ] - + steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5d92ba..91f22db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,14 +23,14 @@ on: # For a patch release, the latest tag is enhanced with 0.0.1, leaving the major and minor versions as # they are. # -# For a minor release, the latest tag is enhanced with 0.1.0, and the patch version is set to 0. +# For a minor release, the latest tag is enhanced with 0.1.0, and the patch version is set to 0. # # For a major release, a branch is created for the latest major release found by tag, and the version # is enhanced with $latest_tag + 1.0.0, increasing the major version by 1 and setting the minor and # patch versions to 0. # # Major version releases are only valid on the "main" branch. -# +# # Once the version is found and enhanced, each project file is updated to the new # version, and a commit is created in the found branch. jobs: @@ -40,7 +40,7 @@ jobs: (github.event_name == 'workflow_dispatch') || ( github.event.pull_request.merged == true && - ( + ( contains(github.event.pull_request.labels.*.name, 'major_release') || contains(github.event.pull_request.labels.*.name, 'minor_release') || contains(github.event.pull_request.labels.*.name, 'patch_release') @@ -112,7 +112,7 @@ jobs: export BRANCH_NAME=$(echo "${{ env.LATEST_VERSION }}" | sed 's/^\([0-9]*\).*/v\1/') git checkout -b "$BRANCH_NAME" git push origin "$BRANCH_NAME" - # create branch of version + # create branch of version - name: prepare project version ${{ env.RELEASE_REF }} ${{ env.LATEST_VERSION }} -> ${{ env.NEW_VERSION }} run: | # jump back for the case that we switched to a tag From 58629b98e1e1ec804c0c74acda299fd8e4af3bee Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Thu, 26 Sep 2024 13:03:00 +0200 Subject: [PATCH 03/26] Change: Rename prod.Dockerfile to Dockerfile --- .docker/{prod.Dockerfile => Dockerfile} | 2 +- .github/workflows/push.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) rename .docker/{prod.Dockerfile => Dockerfile} (87%) diff --git a/.docker/prod.Dockerfile b/.docker/Dockerfile similarity index 87% rename from .docker/prod.Dockerfile rename to .docker/Dockerfile index 4677310..7b01921 100644 --- a/.docker/prod.Dockerfile +++ b/.docker/Dockerfile @@ -9,7 +9,7 @@ COPY . /source RUN sh /source/.github/install-dependencies.sh RUN cmake -DCMAKE_BUILD_TYPE=Release -B/build /source -RUN DESTDIR=/install cmake --build /build -- install +RUN DESTDIR=/install cmake --build /build -- install FROM greenbone/gvm-libs:$VERSION diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 14666fd..7f016aa 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -18,6 +18,7 @@ jobs: name: Build and Push debian:stable to Greenbone Registry uses: greenbone/workflows/.github/workflows/container-build-push-2nd-gen.yml@main with: + build-docker-file: .docker/Dockerfile image-url: community/boreas image-labels: | org.opencontainers.image.vendor=Greenbone From 9e03d1527bd8180a8f6cce56324e4df5d21c890f Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Thu, 26 Sep 2024 13:30:37 +0200 Subject: [PATCH 04/26] Change: Replace build.Dockerfile with build-boreas-action composite action --- .docker/build.Dockerfile | 14 -------------- .github/actions/build-boreas-action/action.yml | 17 +++++++++++++++++ .github/workflows/ci-c.yml | 12 +++++++----- .github/workflows/codeql.yml | 5 ++--- 4 files changed, 26 insertions(+), 22 deletions(-) delete mode 100644 .docker/build.Dockerfile create mode 100644 .github/actions/build-boreas-action/action.yml diff --git a/.docker/build.Dockerfile b/.docker/build.Dockerfile deleted file mode 100644 index f296797..0000000 --- a/.docker/build.Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -ARG VERSION=unstable - -FROM greenbone/gvm-libs:$VERSION -LABEL deprecated="This image is deprecated and may be removed soon." - -RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \ - build-essential \ - curl \ - cmake \ - pkg-config \ - libglib2.0-dev \ - libgnutls28-dev \ - libpcap-dev \ - && rm -rf /var/lib/apt/lists/* diff --git a/.github/actions/build-boreas-action/action.yml b/.github/actions/build-boreas-action/action.yml new file mode 100644 index 0000000..e53f633 --- /dev/null +++ b/.github/actions/build-boreas-action/action.yml @@ -0,0 +1,17 @@ +name: 'Build Boreas' +description: 'builds Boreas from source' +runs: + using: "composite" + steps: + - uses: actions/checkout@v4 + - name: Build Boreas + run: | + apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \ + build-essential \ + curl \ + cmake \ + pkg-config \ + libglib2.0-dev \ + libgnutls28-dev \ + libpcap-dev \ + && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 114646b..aeecd1d 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -11,8 +11,9 @@ jobs: c-format-check: name: Check C Source Code Formatting runs-on: 'ubuntu-latest' + container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: actions/checkout@v4 + - uses: .github/actions/build-boreas-action - name: Check Source Format run: | clang-format -i -style=file src/*.c @@ -21,9 +22,9 @@ jobs: tests: name: Unit Tests runs-on: 'ubuntu-latest' - container: greenbone/boreas-build:unstable + container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: actions/checkout@v4 + - uses: .github/actions/build-boreas-action - name: Configure and Compile boreas run: | mkdir build @@ -31,12 +32,13 @@ jobs: cmake -DCMAKE_BUILD_TYPE=Debug .. make install + scan-build: name: Scan-build with clang runs-on: 'ubuntu-latest' - container: greenbone/boreas-build:unstable + container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: actions/checkout@v4 + - uses: .github/actions/build-boreas-action - name: Install clang tools run: | apt update diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a442f65..057a956 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,7 @@ jobs: actions: read contents: read security-events: write - container: ${{ github.repository }}-build:unstable + container: registry.community.greenbone.net/community/gvm-libs:edge strategy: fail-fast: false @@ -25,8 +25,7 @@ jobs: language: [ 'c' ] steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: .github/actions/build-boreas-action # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 73bd167c712325f4562dcca426bc916e32907ed6 Mon Sep 17 00:00:00 2001 From: robert-schardt Date: Fri, 27 Sep 2024 13:44:57 +0200 Subject: [PATCH 05/26] Update .github/actions/build-boreas-action/action.yml Co-authored-by: Jaspar Stach --- .github/actions/build-boreas-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/build-boreas-action/action.yml b/.github/actions/build-boreas-action/action.yml index e53f633..1a289f8 100644 --- a/.github/actions/build-boreas-action/action.yml +++ b/.github/actions/build-boreas-action/action.yml @@ -3,7 +3,7 @@ description: 'builds Boreas from source' runs: using: "composite" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Build Boreas run: | apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \ From 545b9af9e0a0be0183807ac0744d052e4247d694 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Fri, 27 Sep 2024 13:48:48 +0200 Subject: [PATCH 06/26] Change: Rename build-boreas-action to install-dependencies-action --- .../action.yml | 4 ++-- .github/workflows/ci-c.yml | 6 +++--- .github/workflows/codeql.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) rename .github/actions/{build-boreas-action => install-dependencies-action}/action.yml (85%) diff --git a/.github/actions/build-boreas-action/action.yml b/.github/actions/install-dependencies-action/action.yml similarity index 85% rename from .github/actions/build-boreas-action/action.yml rename to .github/actions/install-dependencies-action/action.yml index 1a289f8..b173a6a 100644 --- a/.github/actions/build-boreas-action/action.yml +++ b/.github/actions/install-dependencies-action/action.yml @@ -1,5 +1,5 @@ -name: 'Build Boreas' -description: 'builds Boreas from source' +name: 'Install dependencies' +description: 'Install dependencies for boreas' runs: using: "composite" steps: diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index aeecd1d..a65a1c8 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -13,7 +13,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: .github/actions/build-boreas-action + - uses: .github/actions/install-dependencies-action - name: Check Source Format run: | clang-format -i -style=file src/*.c @@ -24,7 +24,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: .github/actions/build-boreas-action + - uses: .github/actions/install-dependencies-action - name: Configure and Compile boreas run: | mkdir build @@ -38,7 +38,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: .github/actions/build-boreas-action + - uses: .github/actions/install-dependencies-action - name: Install clang tools run: | apt update diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 057a956..431bcd1 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,7 +25,7 @@ jobs: language: [ 'c' ] steps: - - uses: .github/actions/build-boreas-action + - uses: .github/actions/install-dependencies-action # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 2f09c8ac2d4f3302f45d6f15e597f8a37ca832a7 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Fri, 27 Sep 2024 15:40:15 +0200 Subject: [PATCH 07/26] Add: Set codeql to version v3 via sha --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 431bcd1..c18cd8d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,7 +29,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628 with: languages: ${{ matrix.language }} queries: security-and-quality @@ -41,6 +41,6 @@ jobs: -DCMAKE_BUILD_TYPE=Release .. && make install working-directory: ${{ github.WORKSPACE }} - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@461ef6c76dfe95d5c364de2f431ddbd31a417628 with: category: "/language:${{matrix.language}}" From 7c74b52483285f517f331e270158c8f259a3ab00 Mon Sep 17 00:00:00 2001 From: robert-schardt Date: Mon, 30 Sep 2024 11:37:57 +0200 Subject: [PATCH 08/26] Retrigger CI --- .github/actions/install-dependencies-action/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install-dependencies-action/action.yml b/.github/actions/install-dependencies-action/action.yml index b173a6a..8cdb620 100644 --- a/.github/actions/install-dependencies-action/action.yml +++ b/.github/actions/install-dependencies-action/action.yml @@ -1,5 +1,5 @@ name: 'Install dependencies' -description: 'Install dependencies for boreas' +description: 'Install dependencies for Boreas' runs: using: "composite" steps: From 46edeff77fe786205ae4c5de68d068bcb841c3d4 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 09:54:55 +0200 Subject: [PATCH 09/26] Fix: Add branch reference to github action --- .github/workflows/ci-c.yml | 6 +++--- .github/workflows/codeql.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index a65a1c8..40dd88e 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -13,7 +13,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: .github/actions/install-dependencies-action + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Check Source Format run: | clang-format -i -style=file src/*.c @@ -24,7 +24,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: .github/actions/install-dependencies-action + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Configure and Compile boreas run: | mkdir build @@ -38,7 +38,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: .github/actions/install-dependencies-action + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Install clang tools run: | apt update diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c18cd8d..fc74f32 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,7 +25,7 @@ jobs: language: [ 'c' ] steps: - - uses: .github/actions/install-dependencies-action + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 53d1eb7dadffbe32e8b66cdbfc8eb7db65a73b62 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:01:39 +0200 Subject: [PATCH 10/26] Fix: Add actions/checkout before using composite action --- .github/workflows/ci-c.yml | 3 +++ .github/workflows/codeql.yml | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 40dd88e..9d6b756 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -13,6 +13,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: + - uses: actions/checkout@v4 - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Check Source Format run: | @@ -24,6 +25,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: + - uses: actions/checkout@v4 - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Configure and Compile boreas run: | @@ -38,6 +40,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: + - uses: actions/checkout@v4 - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Install clang tools run: | diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fc74f32..fe3976f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,6 +25,7 @@ jobs: language: [ 'c' ] steps: + - uses: actions/checkout@v4 - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt # Initializes the CodeQL tools for scanning. From d8c92ca3993baf57b7df8e63c584fe05cee6cebe Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:04:57 +0200 Subject: [PATCH 11/26] Fix: Add ./. before using local action --- .github/workflows/ci-c.yml | 6 +++--- .github/workflows/codeql.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 9d6b756..9a5e033 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -14,7 +14,7 @@ jobs: container: registry.community.greenbone.net/community/gvm-libs:edge steps: - uses: actions/checkout@v4 - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Check Source Format run: | clang-format -i -style=file src/*.c @@ -26,7 +26,7 @@ jobs: container: registry.community.greenbone.net/community/gvm-libs:edge steps: - uses: actions/checkout@v4 - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Configure and Compile boreas run: | mkdir build @@ -41,7 +41,7 @@ jobs: container: registry.community.greenbone.net/community/gvm-libs:edge steps: - uses: actions/checkout@v4 - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Install clang tools run: | apt update diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fe3976f..30522ea 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 5734eed8f368ab8d6a4cee6de31f5ad4e9f94181 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:11:02 +0200 Subject: [PATCH 12/26] Fix: Test if setting explicit ref works --- .github/workflows/ci-c.yml | 6 ++++++ .github/workflows/codeql.yml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 9a5e033..d5c443d 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -14,6 +14,8 @@ jobs: container: registry.community.greenbone.net/community/gvm-libs:edge steps: - uses: actions/checkout@v4 + with: + ref: "DEVOPS-1244_rschardt" - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Check Source Format run: | @@ -26,6 +28,8 @@ jobs: container: registry.community.greenbone.net/community/gvm-libs:edge steps: - uses: actions/checkout@v4 + with: + ref: "DEVOPS-1244_rschardt" - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Configure and Compile boreas run: | @@ -41,6 +45,8 @@ jobs: container: registry.community.greenbone.net/community/gvm-libs:edge steps: - uses: actions/checkout@v4 + with: + ref: "DEVOPS-1244_rschardt" - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Install clang tools run: | diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 30522ea..5562f86 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,6 +26,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + ref: "DEVOPS-1244_rschardt" - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt # Initializes the CodeQL tools for scanning. From 41189568713e66b98e7604b6aee764263919bc6d Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:12:43 +0200 Subject: [PATCH 13/26] Fix: Removing ./ again --- .github/workflows/ci-c.yml | 6 +++--- .github/workflows/codeql.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index d5c443d..ba55c95 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 with: ref: "DEVOPS-1244_rschardt" - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Check Source Format run: | clang-format -i -style=file src/*.c @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v4 with: ref: "DEVOPS-1244_rschardt" - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Configure and Compile boreas run: | mkdir build @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@v4 with: ref: "DEVOPS-1244_rschardt" - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Install clang tools run: | apt update diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 5562f86..b0969ac 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 with: ref: "DEVOPS-1244_rschardt" - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 033ab82ba46bec89c855dab32769855a0cf4104d Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:15:01 +0200 Subject: [PATCH 14/26] Fix: Add slashes again and remove checkout --- .github/workflows/ci-c.yml | 15 +++------------ .github/workflows/codeql.yml | 5 +---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index ba55c95..0275f2d 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -13,10 +13,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: actions/checkout@v4 - with: - ref: "DEVOPS-1244_rschardt" - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Check Source Format run: | clang-format -i -style=file src/*.c @@ -27,10 +24,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: actions/checkout@v4 - with: - ref: "DEVOPS-1244_rschardt" - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Configure and Compile boreas run: | mkdir build @@ -44,10 +38,7 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: actions/checkout@v4 - with: - ref: "DEVOPS-1244_rschardt" - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt - name: Install clang tools run: | apt update diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b0969ac..b6e9a1f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,10 +25,7 @@ jobs: language: [ 'c' ] steps: - - uses: actions/checkout@v4 - with: - ref: "DEVOPS-1244_rschardt" - - uses: .github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From b76d67c4a62d84481919b6e6963a727d251ac51b Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:17:38 +0200 Subject: [PATCH 15/26] Fix: Add checkout again and a trailing slash --- .github/workflows/codeql.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b6e9a1f..60120ee 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,7 +25,8 @@ jobs: language: [ 'c' ] steps: - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: actions/checkout@v4 + - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt/ # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From eddd1d6359311fcc8c7a16b3ba436b0744c4ee7e Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:21:33 +0200 Subject: [PATCH 16/26] Fix: Fix trailing slash --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 60120ee..e2f9268 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt/ + - uses: ./.github/actions/install-dependencies-action/@DEVOPS-1244_rschardt # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 1a2fef4d596ed47a696a6547f54467cf5f6635d2 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 10:22:24 +0200 Subject: [PATCH 17/26] Fix: Remove tag --- .github/workflows/codeql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e2f9268..83bf734 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -26,7 +26,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/install-dependencies-action/@DEVOPS-1244_rschardt + - uses: ./.github/actions/install-dependencies-action/ # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 1da30998ad146698c57eec799400b2a015567c5f Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 12:07:37 +0200 Subject: [PATCH 18/26] Fix: Set specific checkout hash and add shell to composite action --- .github/actions/install-dependencies-action/action.yml | 2 +- .github/workflows/codeql.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/install-dependencies-action/action.yml b/.github/actions/install-dependencies-action/action.yml index 8cdb620..5d09f6b 100644 --- a/.github/actions/install-dependencies-action/action.yml +++ b/.github/actions/install-dependencies-action/action.yml @@ -3,8 +3,8 @@ description: 'Install dependencies for Boreas' runs: using: "composite" steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: Build Boreas + shell: bash run: | apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \ build-essential \ diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 83bf734..e0c8c61 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -25,8 +25,8 @@ jobs: language: [ 'c' ] steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/install-dependencies-action/ + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: ./.github/actions/install-dependencies-action # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL From 7f04754f07add46b8217cadd103ac4c151405762 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 12:11:09 +0200 Subject: [PATCH 19/26] Fix: Add changes to ci-c.yml --- .github/workflows/ci-c.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 0275f2d..129f9a5 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -13,7 +13,8 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: ./.github/actions/install-dependencies-action - name: Check Source Format run: | clang-format -i -style=file src/*.c @@ -24,7 +25,8 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: ./.github/actions/install-dependencies-action - name: Configure and Compile boreas run: | mkdir build @@ -38,7 +40,8 @@ jobs: runs-on: 'ubuntu-latest' container: registry.community.greenbone.net/community/gvm-libs:edge steps: - - uses: ./.github/actions/install-dependencies-action@DEVOPS-1244_rschardt + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: ./.github/actions/install-dependencies-action - name: Install clang tools run: | apt update From 33ee86068e2a58c724e9a1fa3019f9358cf6d417 Mon Sep 17 00:00:00 2001 From: robert-schardt Date: Tue, 1 Oct 2024 12:17:51 +0200 Subject: [PATCH 20/26] Update .docker/Dockerfile Co-authored-by: Jaspar Stach --- .docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 77b01f5..b837a61 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -15,4 +15,4 @@ FROM registry.community.greenbone.net/community/gvm-libs:${VERSION} COPY --from=build /install/ / -RUN ldconfig \ No newline at end of file +RUN ldconfig From 3bb303a0c90c853a4d7722f33967352a54564f85 Mon Sep 17 00:00:00 2001 From: robert-schardt Date: Tue, 1 Oct 2024 12:18:14 +0200 Subject: [PATCH 21/26] Update .github/workflows/ci-c.yml Co-authored-by: Jaspar Stach --- .github/workflows/ci-c.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 129f9a5..5ed417e 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -23,7 +23,7 @@ jobs: tests: name: Unit Tests runs-on: 'ubuntu-latest' - container: registry.community.greenbone.net/community/gvm-libs:edge + container: ${{ vars.SELF_HOSTED_REGISTRY }}/community/gvm-libs:edge steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: ./.github/actions/install-dependencies-action From d16b3f6ee776995951baae6aa16d75caa5524b81 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 12:20:57 +0200 Subject: [PATCH 22/26] Fix: Use variable in container registry path --- .github/workflows/ci-c.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 5ed417e..6dd9c85 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -11,7 +11,7 @@ jobs: c-format-check: name: Check C Source Code Formatting runs-on: 'ubuntu-latest' - container: registry.community.greenbone.net/community/gvm-libs:edge + container: ${{ vars.SELF_HOSTED_REGISTRY }}/community/gvm-libs:edge steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: ./.github/actions/install-dependencies-action @@ -38,7 +38,7 @@ jobs: scan-build: name: Scan-build with clang runs-on: 'ubuntu-latest' - container: registry.community.greenbone.net/community/gvm-libs:edge + container: ${{ vars.SELF_HOSTED_REGISTRY }}/community/gvm-libs:edge steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: ./.github/actions/install-dependencies-action diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e0c8c61..69749c8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,7 +17,7 @@ jobs: actions: read contents: read security-events: write - container: registry.community.greenbone.net/community/gvm-libs:edge + container: ${{ vars.SELF_HOSTED_REGISTRY }}/community/gvm-libs:edge strategy: fail-fast: false From 259dfb0afc1dee1194b2cf6998a83d9113cb307f Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 12:26:44 +0200 Subject: [PATCH 23/26] Fix: Add clang-format to c formatting job --- .github/workflows/ci-c.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 6dd9c85..5962e3d 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -15,6 +15,11 @@ jobs: steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - uses: ./.github/actions/install-dependencies-action + - name: Install clang tools + run: | + apt update + apt install --no-install-recommends -y clang-format + rm -rf /var/lib/apt/lists/* - name: Check Source Format run: | clang-format -i -style=file src/*.c From b00b5072bfd2bcb91c9224664eab6c2651df9b74 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 12:33:18 +0200 Subject: [PATCH 24/26] Fix: Add git as a dependency to install-dependencies-action --- .github/actions/install-dependencies-action/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/install-dependencies-action/action.yml b/.github/actions/install-dependencies-action/action.yml index 5d09f6b..474c669 100644 --- a/.github/actions/install-dependencies-action/action.yml +++ b/.github/actions/install-dependencies-action/action.yml @@ -14,4 +14,5 @@ runs: libglib2.0-dev \ libgnutls28-dev \ libpcap-dev \ + git \ && rm -rf /var/lib/apt/lists/* From a46879e8032d79945ee5d60be76827a535109f1d Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 12:39:01 +0200 Subject: [PATCH 25/26] Fix: Remove container from source format and add clang-format and libssh-dev to general action --- .github/actions/install-dependencies-action/action.yml | 2 ++ .github/workflows/ci-c.yml | 7 ------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/actions/install-dependencies-action/action.yml b/.github/actions/install-dependencies-action/action.yml index 474c669..6968646 100644 --- a/.github/actions/install-dependencies-action/action.yml +++ b/.github/actions/install-dependencies-action/action.yml @@ -15,4 +15,6 @@ runs: libgnutls28-dev \ libpcap-dev \ git \ + clang-format \ + libssh-dev && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 5962e3d..55905ba 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -11,15 +11,8 @@ jobs: c-format-check: name: Check C Source Code Formatting runs-on: 'ubuntu-latest' - container: ${{ vars.SELF_HOSTED_REGISTRY }}/community/gvm-libs:edge steps: - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - uses: ./.github/actions/install-dependencies-action - - name: Install clang tools - run: | - apt update - apt install --no-install-recommends -y clang-format - rm -rf /var/lib/apt/lists/* - name: Check Source Format run: | clang-format -i -style=file src/*.c From a6c1b1bc05db2b1fb3a52027314b261bfe5b3e49 Mon Sep 17 00:00:00 2001 From: Robert Schardt Date: Tue, 1 Oct 2024 12:43:02 +0200 Subject: [PATCH 26/26] Fix: Add backslash und removed duplicated clang-format dependency --- .github/actions/install-dependencies-action/action.yml | 2 +- .github/workflows/ci-c.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-dependencies-action/action.yml b/.github/actions/install-dependencies-action/action.yml index 6968646..de4ce76 100644 --- a/.github/actions/install-dependencies-action/action.yml +++ b/.github/actions/install-dependencies-action/action.yml @@ -16,5 +16,5 @@ runs: libpcap-dev \ git \ clang-format \ - libssh-dev + libssh-dev \ && rm -rf /var/lib/apt/lists/* diff --git a/.github/workflows/ci-c.yml b/.github/workflows/ci-c.yml index 55905ba..f4820f2 100644 --- a/.github/workflows/ci-c.yml +++ b/.github/workflows/ci-c.yml @@ -43,7 +43,7 @@ jobs: - name: Install clang tools run: | apt update - apt install --no-install-recommends -y clang clang-format clang-tools + apt install --no-install-recommends -y clang clang-tools rm -rf /var/lib/apt/lists/* - name: Configure and Scan Build boreas run: |