test(loc): add snapshots for LOC command tests #11
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| pull_request: | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| fmt: | |
| name: Rust Fmt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt --all --check | |
| clippy: | |
| name: Rust Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run clippy | |
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| test: | |
| name: Rust Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-insta | |
| run: cargo install cargo-insta --locked | |
| - name: Run tests | |
| run: cargo test --workspace | |
| - name: Verify snapshots | |
| run: cargo insta test --review --workspace | |
| pyright: | |
| name: Pyright | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Run Pyright | |
| run: npm run pyright | |
| benchmark: | |
| name: Benchmark | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run benchmark suite | |
| run: python benchmarks/run.py --datasets small medium large | |
| - name: Upload benchmark reports | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: benchmark-reports | |
| path: benchmarks/reports/ | |
| if-no-files-found: error | |
| fuzz_smoke: | |
| name: Fuzz Smoke (${{ matrix.target }}) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: scan_content_newlines | |
| seed_dir: fuzz/seeds/scan_content_newlines | |
| - target: render_loc_table | |
| seed_dir: fuzz/seeds/render_loc_table | |
| - target: build_context_report | |
| seed_dir: fuzz/seeds/build_context_report | |
| - target: render_context_markdown | |
| seed_dir: fuzz/seeds/render_context_markdown | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| - name: Cache Rust artifacts | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install cargo-fuzz | |
| run: cargo install cargo-fuzz --locked | |
| - name: Create fuzz log directory | |
| run: mkdir -p fuzz/logs | |
| - name: Run fuzz smoke target | |
| run: | | |
| cargo +nightly fuzz run "${{ matrix.target }}" "${{ matrix.seed_dir }}" -- -max_total_time=60 \ | |
| | tee "fuzz/logs/${{ matrix.target }}.log" | |
| - name: Upload fuzz smoke artifacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fuzz-smoke-${{ matrix.target }} | |
| path: | | |
| fuzz/logs/${{ matrix.target }}.log | |
| fuzz/artifacts/${{ matrix.target }}/ | |
| if-no-files-found: warn |