Code optimizations #273
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Format Check | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup LLVM | |
| uses: ZhongRuoyu/setup-llvm@v0 | |
| with: | |
| llvm-version: 22 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: 1.95.0 | |
| components: rustfmt, clippy | |
| - name: Setup nightly Rust for rule-preprocessor clippy | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: nightly | |
| components: rustfmt, clippy, rustc-dev | |
| - name: Check C++ formatting | |
| run: find cpp2rust tests -name '*.cpp' -o -name '*.h' -o -name '*.c' | xargs clang-format --dry-run --Werror | |
| - name: Check Rust formatting | |
| run: | | |
| cargo fmt --manifest-path rules/Cargo.toml -- --check | |
| cargo fmt --manifest-path rule-preprocessor/Cargo.toml -- --check | |
| cargo fmt --manifest-path libcc2rs/Cargo.toml -- --check | |
| cargo fmt --manifest-path libcc2rs-macros/Cargo.toml -- --check | |
| find tests -name '*.rs' -print0 | xargs -0 rustfmt --check | |
| - name: Check Rust lints | |
| run: | | |
| cargo clippy --manifest-path rules/Cargo.toml --all-targets --all-features -- -Dwarnings | |
| cargo +nightly clippy --manifest-path rule-preprocessor/Cargo.toml --all-targets --all-features -- -Dwarnings | |
| cargo clippy --manifest-path libcc2rs/Cargo.toml --all-targets --all-features -- -Dwarnings | |
| cargo clippy --manifest-path libcc2rs-macros/Cargo.toml --all-targets --all-features -- -Dwarnings |