Move Clippy to extra CI steps (#1370)
* Move Clippy to extra CI steps * clippy? * Last try with nightly * no clue why but hey * cleanup * more * revert * check ubuntu works * f * debug * clippy_ci * remove tmate * regex --------- Co-authored-by: Dongjia "toka" Zhang <tokazerkje@outlook.com>
This commit is contained in:
parent
989dd4d89a
commit
207e7dbdff
85
.github/workflows/build_and_test.yml
vendored
85
.github/workflows/build_and_test.yml
vendored
@ -24,6 +24,9 @@ jobs:
|
|||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
override: true
|
override: true
|
||||||
|
- name: Install mimetype
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
run: sudo apt-get install libfile-mimeinfo-perl
|
||||||
- name: install mdbook
|
- name: install mdbook
|
||||||
uses: baptiste0928/cargo-install@v1.3.0
|
uses: baptiste0928/cargo-install@v1.3.0
|
||||||
with:
|
with:
|
||||||
@ -90,8 +93,6 @@ jobs:
|
|||||||
run: clang-format-13 -n -Werror --style=file $(find . -type f \( -name '*.cpp' -o -iname '*.hpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.cc' -o -name '*.h' \) | grep -v '/target/' | grep -v 'libpng-1\.6\.37' | grep -v 'stb_image\.h' | grep -v 'dlmalloc\.c' | grep -v 'QEMU-Nyx')
|
run: clang-format-13 -n -Werror --style=file $(find . -type f \( -name '*.cpp' -o -iname '*.hpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.cc' -o -name '*.h' \) | grep -v '/target/' | grep -v 'libpng-1\.6\.37' | grep -v 'stb_image\.h' | grep -v 'dlmalloc\.c' | grep -v 'QEMU-Nyx')
|
||||||
- name: run shellcheck
|
- name: run shellcheck
|
||||||
run: shellcheck ./scripts/*.sh
|
run: shellcheck ./scripts/*.sh
|
||||||
- name: Run clippy
|
|
||||||
run: ./scripts/clippy.sh
|
|
||||||
|
|
||||||
# ---- doc check ----
|
# ---- doc check ----
|
||||||
- name: Build Docs
|
- name: Build Docs
|
||||||
@ -107,6 +108,28 @@ jobs:
|
|||||||
# --- miri undefined behavior test --
|
# --- miri undefined behavior test --
|
||||||
- name: Run miri tests
|
- name: Run miri tests
|
||||||
run: RUST_BACKTRACE=1 MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test
|
run: RUST_BACKTRACE=1 MIRIFLAGS="-Zmiri-disable-isolation" cargo +nightly miri test
|
||||||
|
|
||||||
|
ubuntu-clippy:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Remove Dotnet & Haskell
|
||||||
|
run: rm -rf /usr/share/dotnet && rm -rf /opt/ghc
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
- name: Install and cache deps
|
||||||
|
uses: awalsh128/cache-apt-pkgs-action@v1.1.0
|
||||||
|
with:
|
||||||
|
packages: llvm-15 clang-15 llvm-15-dev ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev
|
||||||
|
- name: get clang version
|
||||||
|
run: command -v llvm-config-15 && clang-15 -v
|
||||||
|
- name: Add nightly rustfmt and clippy
|
||||||
|
run: rustup toolchain install nightly --component clippy --allow-downgrade && rustup default nightly
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: Run clippy
|
||||||
|
run: ./scripts/clippy.sh
|
||||||
|
|
||||||
# Clean up files to save up disk space
|
# Clean up files to save up disk space
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
@ -347,7 +370,7 @@ jobs:
|
|||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
override: true
|
override: true
|
||||||
components: rustfmt, clippy, rust-src
|
components: rustfmt, rust-src
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: Add targets
|
- name: Add targets
|
||||||
@ -358,6 +381,20 @@ jobs:
|
|||||||
run: cd ./fuzzers/baby_no_std && cargo +nightly run || test $? -ne 0 || exit 1
|
run: cd ./fuzzers/baby_no_std && cargo +nightly run || test $? -ne 0 || exit 1
|
||||||
- name: no_std tests
|
- name: no_std tests
|
||||||
run: cd ./libafl && cargo test --no-default-features
|
run: cd ./libafl && cargo test --no-default-features
|
||||||
|
|
||||||
|
nostd-clippy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: nightly
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy, rust-src
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: Add targets
|
||||||
|
run: rustup target add arm-linux-androideabi && rustup target add thumbv6m-none-eabi
|
||||||
- name: libafl armv6m-none-eabi (32 bit no_std) clippy
|
- name: libafl armv6m-none-eabi (32 bit no_std) clippy
|
||||||
run: cd ./libafl && cargo clippy --target thumbv6m-none-eabi --no-default-features
|
run: cd ./libafl && cargo clippy --target thumbv6m-none-eabi --no-default-features
|
||||||
- name: Build no_std no_alloc bolts
|
- name: Build no_std no_alloc bolts
|
||||||
@ -381,10 +418,6 @@ jobs:
|
|||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: Windows Build
|
- name: Windows Build
|
||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run clippy
|
|
||||||
uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: clippy
|
|
||||||
- name: Build docs
|
- name: Build docs
|
||||||
run: cargo doc
|
run: cargo doc
|
||||||
- name: Set LIBCLANG_PATH
|
- name: Set LIBCLANG_PATH
|
||||||
@ -402,7 +435,21 @@ jobs:
|
|||||||
run: cd fuzzers/frida_gdiplus/ && cargo make test
|
run: cd fuzzers/frida_gdiplus/ && cargo make test
|
||||||
- name: Build fuzzers/tinyinst_simple
|
- name: Build fuzzers/tinyinst_simple
|
||||||
run: cd fuzzers/tinyinst_simple/ && cargo make test
|
run: cd fuzzers/tinyinst_simple/ && cargo make test
|
||||||
|
|
||||||
|
windows-clippy:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: Run clippy
|
||||||
|
uses: actions-rs/cargo@v1
|
||||||
|
with:
|
||||||
|
command: clippy
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
steps:
|
steps:
|
||||||
@ -411,7 +458,7 @@ jobs:
|
|||||||
profile: minimal
|
profile: minimal
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
- name: Add nightly rustfmt and clippy
|
- name: Add nightly rustfmt and clippy
|
||||||
run: rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade
|
run: rustup toolchain install nightly --component rustfmt --component clippy --allow-downgrade && rustup default nightly
|
||||||
- name: Install ucd-generate
|
- name: Install ucd-generate
|
||||||
run: cargo install -f ucd-generate
|
run: cargo install -f ucd-generate
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
@ -422,13 +469,29 @@ jobs:
|
|||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
- name: MacOS Build
|
- name: MacOS Build
|
||||||
run: cargo build --verbose
|
run: cargo build --verbose
|
||||||
- name: Run clippy
|
|
||||||
run: ./scripts/clippy.sh
|
|
||||||
- name: Increase map sizes
|
- name: Increase map sizes
|
||||||
run: ./scripts/shmem_limits_macos.sh
|
run: ./scripts/shmem_limits_macos.sh
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: cargo test
|
run: cargo test
|
||||||
|
|
||||||
|
macos-clippy:
|
||||||
|
runs-on: macOS-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
profile: minimal
|
||||||
|
toolchain: stable
|
||||||
|
- name: Add nightly rustfmt and clippy
|
||||||
|
run: rustup toolchain install nightly --component clippy --allow-downgrade && rustup default nightly
|
||||||
|
- name: Install deps
|
||||||
|
run: brew install z3 gtk+3
|
||||||
|
- name: Install cxxbridge
|
||||||
|
run: cargo install cxxbridge-cmd
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
- name: Run clippy
|
||||||
|
run: ./scripts/clippy.sh
|
||||||
|
|
||||||
other_targets:
|
other_targets:
|
||||||
runs-on: macOS-latest
|
runs-on: macOS-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -14,7 +14,7 @@ const SYMCC_RUNTIME_FUNCTION_NAME_PREFIX: &str = "_cpp_";
|
|||||||
|
|
||||||
thread_local! {
|
thread_local! {
|
||||||
static FUNCTION_NAME_REGEX: RefCell<Regex> = RefCell::new(Regex::new(r"pub fn (\w+)").unwrap());
|
static FUNCTION_NAME_REGEX: RefCell<Regex> = RefCell::new(Regex::new(r"pub fn (\w+)").unwrap());
|
||||||
static EXPORTED_FUNCTION_REGEX: RefCell<Regex> = RefCell::new(RegexBuilder::new(r"(pub fn \w+\([^\)]*\)[^;]*);")
|
static EXPORTED_FUNCTION_REGEX: RefCell<Regex> = RefCell::new(RegexBuilder::new(r"(pub fn \w+\s*\([^\)]*\)[^;]*);")
|
||||||
.multi_line(true)
|
.multi_line(true)
|
||||||
.build()
|
.build()
|
||||||
.unwrap());
|
.unwrap());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user