From dca98cb3ec88803ffd68c691c5dd3d24e113b6a4 Mon Sep 17 00:00:00 2001 From: Azreyo <58790873+Azreyo@users.noreply.github.com> Date: Sat, 20 Dec 2025 23:02:56 +0100 Subject: [PATCH] fix: streamline CI workflow by removing unnecessary sudo commands and adding missing dependencies --- .github/workflows/c-cpp.yml | 58 +++++++++++++++++++++++-------------- .github/workflows/ci.yml | 32 ++++++++++++-------- 2 files changed, 57 insertions(+), 33 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index e916f48..8426299 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -12,20 +12,23 @@ on: jobs: build: runs-on: ubuntu-latest + container: + image: debian:bookworm steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install build dependencies run: | - sudo apt-get update - sudo apt-get install -y \ + apt-get update + apt-get install -y \ build-essential \ libssl-dev \ libmagic-dev \ libnghttp2-dev \ - pkg-config + pkg-config \ + git + + - name: Checkout repository + uses: actions/checkout@v4 - name: Build project run: | @@ -41,15 +44,24 @@ jobs: test: runs-on: ubuntu-latest needs: build + container: + image: debian:bookworm steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install -y build-essential + apt-get update + apt-get install -y \ + build-essential \ + libssl-dev \ + libmagic-dev \ + libnghttp2-dev \ + pkg-config \ + git \ + file + + - name: Checkout repository + uses: actions/checkout@v4 - name: Build again for testing run: | @@ -71,15 +83,17 @@ jobs: code-quality: runs-on: ubuntu-latest + container: + image: debian:bookworm steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install code quality tools run: | - sudo apt-get update - sudo apt-get install -y cppcheck clang-format + apt-get update + apt-get install -y cppcheck clang-format git + + - name: Checkout repository + uses: actions/checkout@v4 - name: Run Cppcheck run: | @@ -107,15 +121,17 @@ jobs: security-scan: runs-on: ubuntu-latest + container: + image: debian:bookworm steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install security tools run: | - sudo apt-get update - sudo apt-get install -y flawfinder cppcheck + apt-get update + apt-get install -y flawfinder cppcheck git + + - name: Checkout repository + uses: actions/checkout@v4 - name: Run Flawfinder run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a75f94e..53f9077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,12 +12,14 @@ on: jobs: build: runs-on: ubuntu-latest + container: + image: debian:bookworm steps: - - uses: actions/checkout@v4 - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install -y build-essential libssl-dev libmagic-dev libnghttp2-dev pkg-config + apt-get update + apt-get install -y build-essential libssl-dev libmagic-dev libnghttp2-dev pkg-config git + - uses: actions/checkout@v4 - name: Build project run: make clean && make - name: Upload build artifacts @@ -29,12 +31,14 @@ jobs: test: runs-on: ubuntu-latest needs: build + container: + image: debian:bookworm steps: - - uses: actions/checkout@v4 - name: Install dependencies run: | - sudo apt-get update - sudo apt-get install -y build-essential libssl-dev libmagic-dev libnghttp2-dev pkg-config + apt-get update + apt-get install -y build-essential libssl-dev libmagic-dev libnghttp2-dev pkg-config git file + - uses: actions/checkout@v4 - name: Build and run tests run: | make clean && make @@ -46,12 +50,14 @@ jobs: security-scan: runs-on: ubuntu-latest + container: + image: debian:bookworm steps: - - uses: actions/checkout@v4 - name: Install security tools run: | - sudo apt-get update - sudo apt-get install -y cppcheck flawfinder + apt-get update + apt-get install -y cppcheck flawfinder git + - uses: actions/checkout@v4 - name: Run Flawfinder run: | flawfinder --minlevel=1 --html --context src/ > flawfinder-report.html || true @@ -63,12 +69,14 @@ jobs: code-quality: runs-on: ubuntu-latest + container: + image: debian:bookworm steps: - - uses: actions/checkout@v4 - name: Install code quality tools run: | - sudo apt-get update - sudo apt-get install -y cppcheck clang-format clang-tidy + apt-get update + apt-get install -y cppcheck clang-format clang-tidy git + - uses: actions/checkout@v4 - name: Run Cppcheck run: | cppcheck --enable=all --inconclusive --error-exitcode=0 \