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 build of boreas-build/build.Dockerfile in boreas #69

Merged
merged 28 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
80caf48
Replace container.yml with push.yml
Sep 26, 2024
8f097ed
Change: Remove whitespaces
Sep 26, 2024
58629b9
Change: Rename prod.Dockerfile to Dockerfile
Sep 26, 2024
9e03d15
Change: Replace build.Dockerfile with build-boreas-action composite a…
Sep 26, 2024
73bd167
Update .github/actions/build-boreas-action/action.yml
robert-schardt Sep 27, 2024
545b9af
Change: Rename build-boreas-action to install-dependencies-action
Sep 27, 2024
2f09c8a
Add: Set codeql to version v3 via sha
Sep 27, 2024
6a70e6c
Merge branch 'main' into DEVOPS-1244_rschardt
Sep 30, 2024
7c74b52
Retrigger CI
robert-schardt Sep 30, 2024
46edeff
Fix: Add branch reference to github action
Oct 1, 2024
53d1eb7
Fix: Add actions/checkout before using composite action
Oct 1, 2024
d8c92ca
Fix: Add ./. before using local action
Oct 1, 2024
5734eed
Fix: Test if setting explicit ref works
Oct 1, 2024
4118956
Fix: Removing ./ again
Oct 1, 2024
033ab82
Fix: Add slashes again and remove checkout
Oct 1, 2024
b76d67c
Fix: Add checkout again and a trailing slash
Oct 1, 2024
eddd1d6
Fix: Fix trailing slash
Oct 1, 2024
1a2fef4
Fix: Remove tag
Oct 1, 2024
1da3099
Fix: Set specific checkout hash and add shell to composite action
Oct 1, 2024
7f04754
Fix: Add changes to ci-c.yml
Oct 1, 2024
33ee860
Update .docker/Dockerfile
robert-schardt Oct 1, 2024
3bb303a
Update .github/workflows/ci-c.yml
robert-schardt Oct 1, 2024
d16b3f6
Fix: Use variable in container registry path
Oct 1, 2024
259dfb0
Fix: Add clang-format to c formatting job
Oct 1, 2024
b00b507
Fix: Add git as a dependency to install-dependencies-action
Oct 1, 2024
a46879e
Fix: Remove container from source format and add clang-format and lib…
Oct 1, 2024
a6c1b1b
Fix: Add backslash und removed duplicated clang-format dependency
Oct 1, 2024
b64e8a6
Merge branch 'main' into DEVOPS-1244_rschardt
robert-schardt Oct 7, 2024
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
2 changes: 1 addition & 1 deletion .docker/prod.Dockerfile → .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ FROM registry.community.greenbone.net/community/gvm-libs:${VERSION}

COPY --from=build /install/ /

RUN ldconfig
RUN ldconfig
robert-schardt marked this conversation as resolved.
Show resolved Hide resolved
14 changes: 0 additions & 14 deletions .docker/build.Dockerfile

This file was deleted.

17 changes: 17 additions & 0 deletions .github/actions/install-dependencies-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Install dependencies'
description: 'Install dependencies for Boreas'
runs:
using: "composite"
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- 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/*
12 changes: 7 additions & 5 deletions .github/workflows/ci-c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/install-dependencies-action
- name: Check Source Format
run: |
clang-format -i -style=file src/*.c
Expand All @@ -21,22 +22,23 @@ jobs:
tests:
name: Unit Tests
runs-on: 'ubuntu-latest'
container: greenbone/boreas-build:unstable
container: registry.community.greenbone.net/community/gvm-libs:edge
robert-schardt marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v4
- uses: .github/actions/install-dependencies-action
- name: Configure and Compile boreas
run: |
mkdir build
cd build
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/install-dependencies-action
- name: Install clang tools
run: |
apt update
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ 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
matrix:
language: [ 'c' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: .github/actions/install-dependencies-action

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
robert-schardt marked this conversation as resolved.
Show resolved Hide resolved
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@461ef6c76dfe95d5c364de2f431ddbd31a417628
with:
languages: ${{ matrix.language }}
queries: security-and-quality
Expand All @@ -42,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}}"
84 changes: 0 additions & 84 deletions .github/workflows/container.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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:
build-docker-file: .docker/Dockerfile
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
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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')
Expand Down Expand Up @@ -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
Expand Down
Loading