From 4671a5ee51409ee2819ae660cbe5043df1ece070 Mon Sep 17 00:00:00 2001 From: Adrien Date: Thu, 1 May 2025 22:32:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Use=20of=20the=20ci-lint-audit?= =?UTF-8?q?=20docker=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .woodpecker/.validate.yaml | 31 +++++++++++++++---------------- docker/Dockerfile.ci-lint-audit | 26 +++++++++++++++++++++----- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.woodpecker/.validate.yaml b/.woodpecker/.validate.yaml index 38233e5..7da50a4 100644 --- a/.woodpecker/.validate.yaml +++ b/.woodpecker/.validate.yaml @@ -1,38 +1,37 @@ +variables: + - &image rg.fr-par.scw.cloud/asr-projects/beau-gosse-du-92/ci-lint-audit:latest + steps: - name: lint - format - image: rust:1.86 + image: *image + pull: true commands: | - rustup component add rustfmt cargo fmt --all --check - name: lint - sort derives - image: rust:1.86 + image: *image + pull: true commands: | - cargo install --locked cargo-sort-derives cargo sort-derives --check - name: lint - clippy - image: rust:1.86 + image: *image + pull: true commands: | - apt update && apt install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev - rustup component add clippy cargo clippy --all --all-features -- -D warnings # Not ready to block PR on fail failure: ignore - name: lint - spellcheck - image: rust:1.86 + image: *image + pull: true commands: | - apt update && apt install -y libclang-dev hunspell - cargo install --locked cargo-spellcheck cargo spellcheck - name: lint - dependencies - image: rust:1.86 + image: *image + pull: true commands: | - apt update && apt install -y libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev - cargo install --locked cargo-udeps - rustup default nightly cargo udeps - name: build - web (dockerize) @@ -46,9 +45,9 @@ steps: dry-run: true - name: audit - dependencies - image: rust:1.86 + image: *image + pull: true commands: | - cargo install --locked cargo-deny cargo deny check # Not ready to block PR on fail failure: ignore diff --git a/docker/Dockerfile.ci-lint-audit b/docker/Dockerfile.ci-lint-audit index e1cbc69..ef8515e 100644 --- a/docker/Dockerfile.ci-lint-audit +++ b/docker/Dockerfile.ci-lint-audit @@ -1,10 +1,26 @@ -FROM rust:1.86 +FROM rust:1.86 AS builder RUN apt update \ - && apt install -y --no-install-recommends git libgtk-3-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev libclang-dev hunspell \ + && apt install -y --no-install-recommends libclang-dev hunspell \ && apt clean -RUN rustup component add rustfmt clippy \ - && rustup default nightly +RUN rustup default nightly \ + && rustup component add rustfmt clippy -RUN cargo install --locked cargo-sort-derives cargo-spellcheck cargo-udeps cargo-deny +RUN cargo install cargo-binstall + +RUN cargo binstall cargo-sort-derives cargo-spellcheck cargo-udeps cargo-deny + + +FROM debian:trixie-slim + +RUN apt update \ + && apt install -y --no-install-recommends ca-certificates git rustup build-essential \ + libssl-dev pkg-config libglib2.0-0 libpango-1.0-0 libatk1.0-dev libgdk-pixbuf-2.0-dev \ + libcairo2-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev \ + && apt clean + +COPY --from=builder /usr/local/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/ /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/ +COPY --from=builder /usr/local/cargo/bin /root/.cargo/bin/ + +RUN rustup default nightly