From 4b4212f5cc5231383a54f11b685857049f8ed418 Mon Sep 17 00:00:00 2001 From: Dmitrii Dolgov <9erthalion6@gmail.com> Date: Wed, 18 Feb 2026 16:18:38 +0100 Subject: [PATCH] Move clippy into the image To avoid differences in versions, move clippy and formatting checks into the image. --- .github/workflows/main.yml | 14 -------------- Dockerfile | 2 +- Dockerfile.build | 27 ++++++++++++++++++++++++--- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4808d9..121ffc8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,20 +11,6 @@ concurrency: cancel-in-progress: true jobs: - lint-and-test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Check code formatting - run: cargo fmt --check - - - name: Run clippy - run: cargo clippy -- -D warnings - - - name: Run tests - run: cargo test - build-and-push: runs-on: ubuntu-latest steps: diff --git a/Dockerfile b/Dockerfile index 346f828..b4df51e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM builder:latest as builder -FROM registry.fedoraproject.org/fedora:41 +FROM registry.fedoraproject.org/fedora:42 RUN mkdir /etc/berserker diff --git a/Dockerfile.build b/Dockerfile.build index 46c5174..f0c7c06 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,11 +1,32 @@ -FROM registry.fedoraproject.org/fedora:41 +FROM registry.fedoraproject.org/fedora:42 -RUN dnf install -y rust cargo nasm +RUN dnf install -y \ + rust \ + cargo \ + clippy \ + rustfmt \ + # for stub \ + nasm \ + # for script jit \ + llvm-devel \ + zlib-devel \ + libxml2-devel \ + libstdc++-static \ + # for bpf \ + clang \ + kernel-devel \ + libbpf-devel ADD ./ /berserker/ WORKDIR /berserker/ +RUN nasm -f elf64 -o stub.o stub.asm && ld -o stub stub.o + +RUN cargo fmt --check + +RUN cargo clippy -- -D warnings + RUN cargo build -r -RUN nasm -f elf64 -o stub.o stub.asm && ld -o stub stub.o +RUN cargo test