mirror of
https://github.com/okhsunrog/vpnhide.git
synced 2026-04-28 06:31:27 +00:00
ci: add clang-format, ktlint, and cargo test to lint job
- Rename lint-rust → lint, add clang-format and ktlint checks - Add cargo test step for zygisk unit tests - Install clang-format and ktlint 1.8.0 in CI Docker image
This commit is contained in:
parent
e2d41dea13
commit
b4677cdb25
2 changed files with 20 additions and 1 deletions
7
.github/docker/ci/Dockerfile
vendored
7
.github/docker/ci/Dockerfile
vendored
|
|
@ -19,9 +19,16 @@ RUN apt-get update && \
|
|||
openjdk-17-jdk-headless \
|
||||
bc kmod cpio flex bison libssl-dev libelf-dev \
|
||||
binutils-aarch64-linux-gnu \
|
||||
clang-format \
|
||||
git && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# ── ktlint (for lsposed / test-app Kotlin) ──────────────────────────
|
||||
ENV KTLINT_VERSION=1.8.0
|
||||
RUN curl -fsSL -o /usr/local/bin/ktlint \
|
||||
"https://github.com/pinterest/ktlint/releases/download/${KTLINT_VERSION}/ktlint" && \
|
||||
chmod +x /usr/local/bin/ktlint
|
||||
|
||||
# ── Rust toolchain (for zygisk) ──────────────────────────────────────
|
||||
ENV RUSTUP_HOME=/usr/local/rustup \
|
||||
CARGO_HOME=/usr/local/cargo \
|
||||
|
|
|
|||
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
|
|
@ -12,7 +12,7 @@ permissions:
|
|||
packages: read
|
||||
|
||||
jobs:
|
||||
lint-rust:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/${{ github.repository }}/ci:latest
|
||||
|
|
@ -25,6 +25,8 @@ jobs:
|
|||
submodules: recursive
|
||||
- name: Mark workspace safe
|
||||
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
# Rust
|
||||
- name: rustfmt
|
||||
run: |
|
||||
cd zygisk && cargo fmt --check
|
||||
|
|
@ -33,6 +35,16 @@ jobs:
|
|||
run: cd zygisk && cargo ndk -t arm64-v8a clippy -- -D warnings
|
||||
- name: clippy (test-app)
|
||||
run: cd test-app/native && cargo ndk -t arm64-v8a clippy -- -D warnings
|
||||
- name: cargo test (zygisk)
|
||||
run: cd zygisk && cargo test
|
||||
|
||||
# C (kernel module)
|
||||
- name: clang-format
|
||||
run: clang-format --dry-run --Werror kmod/vpnhide_kmod.c
|
||||
|
||||
# Kotlin
|
||||
- name: ktlint
|
||||
run: ktlint "lsposed/**/*.kt" "test-app/**/*.kt"
|
||||
|
||||
kmod:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue