From 8d66bb67030051e93af13f5190d65968b2e25e0e Mon Sep 17 00:00:00 2001 From: Lorenzo Mec-iS Date: Mon, 24 Nov 2025 01:51:41 +0000 Subject: [PATCH 1/4] bump version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9b5bf8b7..bd569cf4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "smartcore" description = "Machine Learning in Rust." homepage = "https://smartcorelib.org" -version = "0.4.6" +version = "0.4.7" authors = ["smartcore Developers"] edition = "2021" license = "Apache-2.0" From 991828d78c75412d41d483024da467114efc2e41 Mon Sep 17 00:00:00 2001 From: Lorenzo Mec-iS Date: Mon, 24 Nov 2025 02:04:04 +0000 Subject: [PATCH 2/4] fix workflow --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dd3361c..35daf1cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,13 @@ name: CI + on: push: branches: [main, development] pull_request: branches: [development] + jobs: tests: runs-on: "${{ matrix.platform.os }}-latest" @@ -30,8 +32,8 @@ jobs: path: | ~/.cargo ./target - key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.toml') }} + key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('Cargo.toml') }} + restore-keys: ${{ runner.os }}-cargo-${{ matrix.platform.target }} - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -78,8 +80,8 @@ jobs: path: | ~/.cargo ./target - key: ${{ runner.os }}-cargo-features-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-cargo-features-${{ hashFiles('**/Cargo.toml') }} + key: ${{ runner.os }}-cargo-features-${{ hashFiles('Cargo.toml') }} + restore-keys: ${{ runner.os }}-cargo-features - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: From 81be751ca2427c599f9f2501b18803ed28f93852 Mon Sep 17 00:00:00 2001 From: Lorenzo Mec-iS Date: Mon, 24 Nov 2025 02:14:36 +0000 Subject: [PATCH 3/4] modernise Rust toolchain used in CI --- .github/workflows/ci.yml | 36 +++++++++--------------------------- .github/workflows/lint.yml | 28 ++++++++++------------------ 2 files changed, 19 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 35daf1cd..267a0b87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,7 @@ name: CI + on: push: branches: [main, development] @@ -8,6 +9,7 @@ on: branches: [development] + jobs: tests: runs-on: "${{ matrix.platform.os }}-latest" @@ -35,31 +37,19 @@ jobs: key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('Cargo.toml') }} restore-keys: ${{ runner.os }}-cargo-${{ matrix.platform.target }} - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - target: ${{ matrix.platform.target }} - profile: minimal - default: true + targets: ${{ matrix.platform.target }} - name: Install test runner for wasm if: matrix.platform.target == 'wasm32-unknown-unknown' run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - name: Stable Build with all features - uses: actions-rs/cargo@v1 - with: - command: build - args: --all-features --target ${{ matrix.platform.target }} + run: cargo build --all-features --target ${{ matrix.platform.target }} - name: Stable Build without features - uses: actions-rs/cargo@v1 - with: - command: build - args: --target ${{ matrix.platform.target }} + run: cargo build --target ${{ matrix.platform.target }} - name: Tests if: matrix.platform.target == 'x86_64-unknown-linux-gnu' || matrix.platform.target == 'x86_64-pc-windows-msvc' || matrix.platform.target == 'aarch64-apple-darwin' - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features + run: cargo test --all-features - name: Tests in WASM if: matrix.platform.target == 'wasm32-unknown-unknown' run: wasm-pack test --node -- --all-features @@ -83,14 +73,6 @@ jobs: key: ${{ runner.os }}-cargo-features-${{ hashFiles('Cargo.toml') }} restore-keys: ${{ runner.os }}-cargo-features - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.platform.target }} - profile: minimal - default: true + uses: dtolnay/rust-toolchain@stable - name: Stable Build - uses: actions-rs/cargo@v1 - with: - command: build - args: --no-default-features ${{ matrix.features }} + run: cargo build --no-default-features ${{ matrix.features }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8c7fd083..c92db59b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,41 +1,33 @@ name: Lint checks + on: push: branches: [ main, development ] pull_request: branches: [ development ] + jobs: lint: runs-on: ubuntu-latest env: TZ: "/usr/share/zoneinfo/your/location" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Cache .cargo and target uses: actions/cache@v4 with: path: | ~/.cargo ./target - key: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }} - restore-keys: ${{ runner.os }}-lint-cargo-${{ hashFiles('**/Cargo.toml') }} + key: ${{ runner.os }}-lint-cargo-${{ hashFiles('Cargo.toml') }} + restore-keys: ${{ runner.os }}-lint-cargo - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - toolchain: stable - profile: minimal - default: true - - run: rustup component add rustfmt - - name: Check formt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - run: rustup component add clippy + components: rustfmt, clippy + - name: Check format + run: cargo fmt --all -- --check - name: Run clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-features -- -Drust-2018-idioms -Dwarnings + run: cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings From dcce0f04cd900b9c983b72e57266dead1e323b28 Mon Sep 17 00:00:00 2001 From: Lorenzo Mec-iS Date: Mon, 24 Nov 2025 02:22:58 +0000 Subject: [PATCH 4/4] fix cache failing to find Cargo.toml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e7aca0b..0762e08f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: path: | ~/.cargo ./target - key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('Cargo.toml') }} + key: ${{ runner.os }}-cargo-${{ matrix.platform.target }}-${{ hashFiles('**/Cargo.toml') }} restore-keys: ${{ runner.os }}-cargo-${{ matrix.platform.target }} - name: Install Rust toolchain uses: dtolnay/rust-toolchain@stable