From d6bb922a7648805a2cdcc76121cf6b963bd2cb3e Mon Sep 17 00:00:00 2001 From: Wildan M Date: Wed, 8 Jul 2026 04:21:33 +0700 Subject: [PATCH] CI: Add clippy check --- .gitlab-ci.yml | 14 ++++++++++++++ check.sh | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 61e301ae68..20de4a035f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,10 +22,20 @@ fmt: - rustup component add rustfmt-preview - ./fmt.sh -- --check +clippy: + stage: build + needs: [] + # TODO: remove when passed + allow_failure: true + script: + - ./check.sh --clippy + linux: stage: build script: + - rustup component add clippy - ./check.sh --host +# - ./check.sh --host --clippy x86_64: stage: build @@ -36,17 +46,20 @@ i586: stage: cross-build script: - ./check.sh --arch=i586 +# - ./check.sh --arch=i586 --clippy aarch64: stage: cross-build image: "redoxos/redoxer:aarch64" script: - ./check.sh --arch=aarch64 +# - ./check.sh --arch=aarch64 --clippy riscv64gc: stage: cross-build script: - ./check.sh --arch=riscv64gc +# - ./check.sh --arch=riscv64gc --clippy test:linux: stage: test @@ -67,6 +80,7 @@ test:aarch64: image: "redoxos/redoxer:aarch64" # many issues that not exist in x86_64, and lack of interest to fix so far allow_failure: true + when: manual script: - timeout -s KILL 9m ./check.sh --arch=aarch64 --test diff --git a/check.sh b/check.sh index f359d7f139..dd8ad6edc3 100755 --- a/check.sh +++ b/check.sh @@ -68,6 +68,10 @@ while [[ $# -gt 0 ]]; do --cargo) CMD_ACTION="cargo" ;; + --clippy) + CMD_ACTION="cargo" + CARGO_ACTION="clippy" + ;; --host) CURRENT_TARGET="$(uname -m)-unknown-linux-gnu" IS_HOST=1 @@ -123,7 +127,7 @@ run_redoxer() { if [ "$CMD_ACTION" == "make" ]; then CMD_OPT="-j $(nproc) $MAKE_ACTION" else - CMD_OPT="$CARGO_ACTION" + CMD_OPT="$CARGO_ACTION --target=$TARGET" fi echo "----------------------------------------"