From 294091b65e020643a1ba14b58d3f749c4bd3ff2a Mon Sep 17 00:00:00 2001 From: Manuel Alonso <434575+manute@users.noreply.github.com> Date: Sat, 22 Nov 2025 06:35:01 +0100 Subject: [PATCH 1/2] chore(ci): improve CI workflow --- .github/workflows/ci.yml | 78 +++++++++------------------------------- 1 file changed, 17 insertions(+), 61 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 417175e..4ec5117 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,73 +1,29 @@ -# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md - name: CI + on: - push: - branches: - - "**" + push: { branches: ["**"] } + pull_request: { branches: ["**"] } jobs: - check: - name: Check + ci: + name: Rust CI runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - name: Run cargo check - uses: actions-rs/cargo@v1 - with: - command: check - test: - name: Test Suite - runs-on: ubuntu-latest steps: - - name: Checkout sources - uses: actions/checkout@v2 - - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - name: Checkout + uses: actions/checkout@v4 - - name: Run cargo test - uses: actions-rs/cargo@v1 - with: - command: test + - name: Install Rust (stable) + uses: dtolnay/rust-toolchain@stable - lints: - name: Lints - runs-on: ubuntu-latest - steps: - - name: Checkout sources - uses: actions/checkout@v2 + - name: Cache Cargo + uses: Swatinem/rust-cache@v2 - - name: Install stable toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - components: rustfmt, clippy + - name: Format check + run: cargo fmt --all -- --check - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check + - name: Clippy (deny warnings) + run: cargo clippy --all-targets --all-features -- -D warnings - - name: Run cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings + - name: Unit tests + run: cargo test --all --all-features --verbose From a598a48a57017d42d7ceb0f0cee3ae704d93ac64 Mon Sep 17 00:00:00 2001 From: Manuel Alonso <434575+manute@users.noreply.github.com> Date: Sat, 22 Nov 2025 06:37:16 +0100 Subject: [PATCH 2/2] fix(borrowed): no needed --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index bfdf14f..a4ef376 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -173,7 +173,7 @@ impl Loader { /// Read file data into string from path fn read_file(path: &str) -> Result { - let mut file = File::open(&path)?; + let mut file = File::open(path)?; let mut data_file = String::new(); file.read_to_string(&mut data_file)?; Ok(data_file)