Fix clippy lints #454
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 | |
| pull_request: | |
| branches: | |
| - master | |
| schedule: | |
| # Run every night at 8:30 AM UTC | |
| - cron: '30 8 * * *' | |
| env: | |
| RUST_BACKTRACE: 1 | |
| jobs: | |
| test: | |
| name: Test - ${{ matrix.build }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| - linux | |
| - macos | |
| - windows | |
| include: | |
| - build: linux | |
| label: linux_x64 | |
| os: ubuntu-latest | |
| - build: macos | |
| label: macos_arm64 | |
| os: macos-latest | |
| - build: windows | |
| label: windows_x64 | |
| os: windows-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Cache Rust | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('crates/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-test- | |
| - name: Install Rust Tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest, just | |
| - name: Run tests | |
| run: just test | |
| - name: Run tests (no std) | |
| run: just test_nostd | |
| - name: Run tests (safe) | |
| run: just test_safe | |
| - name: Run tests (no std, safe) | |
| run: just test_nostd_safe | |
| miri: | |
| name: Miri | |
| runs-on: ubuntu-latest | |
| env: | |
| MIRIFLAGS: -Zmiri-tag-raw-pointers | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: miri | |
| toolchain: nightly | |
| - name: Cache Rust | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-miri-${{ hashFiles('crates/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-miri- | |
| - name: Install Rust Tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest, just | |
| - name: Run Miri | |
| run: just miri | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Cache Rust | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('crates/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-clippy- | |
| - name: Install Rust Tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest, just | |
| - name: Run Clippy | |
| run: just clippy | |
| wasi_test: | |
| name: WASI Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| target: wasm32-wasip1 | |
| - name: Cache Rust | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-wasi-test-${{ hashFiles('crates/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-wasi-test- | |
| - name: Install Rust Tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest, just | |
| - name: Setup `wasmtime` | |
| uses: bytecodealliance/actions/wasmtime/setup@v1 | |
| # Serde doesn't work on WASI yet when using OsStr/Path (https://github.com/serde-rs/serde/issues/3020) | |
| - name: Run tests | |
| run: just std_features=bytes,cstr,osstr,path,sqlx test --target wasm32-wasip1 | |
| - name: Run tests (serde) | |
| run: just std_features=bytes,cstr,serde,sqlx test --target wasm32-wasip1 | |
| - name: Run tests (no std) | |
| run: just test_nostd --target wasm32-wasip1 | |
| - name: Run tests (safe) | |
| run: just std_features=bytes,cstr,osstr,path,sqlx test_safe --target wasm32-wasip1 | |
| - name: Run tests (safe, serde) | |
| run: just std_features=bytes,cstr,serde,sqlx test_safe --target wasm32-wasip1 | |
| - name: Run tests (no std, safe) | |
| run: just test_nostd_safe --target wasm32-wasip1 | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v5 | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| components: llvm-tools-preview | |
| - name: Cache Rust | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-coverage-${{ hashFiles('crates/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-coverage- | |
| - name: Install Rust Tools | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-nextest, cargo-llvm-cov, just | |
| - name: Run tests with coverage | |
| run: just cover_report | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: codecov.json | |
| token: ${{ secrets.CODECOV_TOKEN }} |