Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-ml/linfa
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.1
Choose a base ref
...
head repository: rust-ml/linfa
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing 346 changed files with 35,586 additions and 7,363 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/benching.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
on: [push, pull_request]

name: Run iai Benches

jobs:
testing:
name: benching
runs-on: ubuntu-latest

steps:
- name: Checkout sources
uses: actions/checkout@master

- name: Install toolchain
uses: dtolnay/rust-toolchain@stable

- name: Run cargo bench iai
run: cargo bench iai --all
38 changes: 24 additions & 14 deletions .github/workflows/checking.yml
Original file line number Diff line number Diff line change
@@ -4,29 +4,39 @@ name: Check For Build Errors

jobs:
check:
name: check
runs-on: ubuntu-latest
name: check-${{ matrix.toolchain }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- 1.42.0
- nightly
- beta
- 1.71.1
- stable
- nightly
os:
- ubuntu-latest
- windows-latest

continue-on-error: ${{ matrix.toolchain == 'nightly' }}

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@master

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all
- name: Log active toolchain
run: rustup show

# Check if linfa compiles by itself without uniting dependency features with other crates
- name: Run cargo check on linfa
run: cargo check

- name: Run cargo check (no features)
run: cargo check --workspace --all-targets

- name: Run cargo check (with serde)
run: cargo check --workspace --all-targets --features "linfa-clustering/serde linfa-ica/serde linfa-kernel/serde linfa-reduction/serde linfa-svm/serde linfa-elasticnet/serde linfa-pls/serde linfa-trees/serde linfa-nn/serde linfa-linear/serde linfa-preprocessing/serde linfa-bayes/serde linfa-logistic/serde linfa-ftrl/serde"
45 changes: 17 additions & 28 deletions .github/workflows/codequality.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
on: [push, pull_request]


name: Codequality Lints

jobs:
@@ -9,57 +10,44 @@ jobs:
strategy:
matrix:
toolchain:
- 1.42.0
- nightly
- beta
- 1.71.1
- stable

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@master

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
run: cargo fmt --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
run: cargo clippy --all-targets -- -D warnings

coverage:
needs: codequality
name: coverage
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/master'

steps:
- name: Checkout sources
uses: actions/checkout@v2
uses: actions/checkout@master

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt, clippy
uses: dtolnay/rust-toolchain@stable

- name: Get rustc version
id: rustc-version
run: echo "::set-output name=version::$(cargo +nightly --version | cut -d ' ' -f 2)"
run: echo "::set-output name=version::$(cargo --version | cut -d ' ' -f 2)"
shell: bash

- uses: actions/cache@v2
- uses: actions/cache@v4
id: tarpaulin-cache
with:
path: |
@@ -68,13 +56,14 @@ jobs:

- name: Install tarpaulin
if: steps.tarpaulin-cache.outputs.cache-hit != 'true'
run: cargo +nightly install cargo-tarpaulin
run: cargo install cargo-tarpaulin

- name: Generate code coverage
run: |
cargo +nightly tarpaulin --verbose --all-features --timeout 120 --out Xml
cargo tarpaulin --verbose --timeout 120 --out Xml --all --release
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# build and deploy on master push, otherwise just try to build the page
on:
push:
branches:
- master
pull_request:

name: Build website with Zola, build rust docs and publish to GH pages

jobs:
build:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/master' && github.repository == 'rust-ml/linfa'
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: 'Build only'
uses: shalzz/zola-deploy-action@master
env:
BUILD_DIR: docs/website/
TOKEN: ${{ secrets.TOKEN }}
BUILD_ONLY: true

- name: Build Documentation
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings

build_and_deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' || github.repository != 'rust-ml/linfa'
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, rust-src

- name: Build Documentation
run: cargo doc --workspace --no-deps
env:
RUSTDOCFLAGS: -D warnings

- name: Copy Rust Documentation to Zola
run: cp -R "target/doc/" "docs/website/static/rustdocs/"

- name: 'Build and deploy'
uses: shalzz/zola-deploy-action@master
env:
PAGES_BRANCH: gh-pages
BUILD_DIR: docs/website/
TOKEN: ${{ secrets.TOKEN }}
48 changes: 34 additions & 14 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -4,31 +4,51 @@ name: Run Tests

jobs:
testing:
name: testing
runs-on: ubuntu-latest
name: testing-${{ matrix.toolchain }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- 1.71.1
- stable
os:
- ubuntu-latest
- windows-latest

steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install ubuntu packages
run: sudo apt-get install libssl-dev gfortran libopenblas-dev liblapack-dev liblapacke-dev libatlas-base-dev
uses: actions/checkout@master

- name: Install toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true

- name: Run cargo test
uses: actions-rs/cargo@v1
run: cargo test --release --workspace

testing-blas:
name: testing-with-BLAS-${{ matrix.toolchain }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- 1.71.1
- stable
os:
- ubuntu-latest
- windows-latest

steps:
- name: Checkout sources
uses: actions/checkout@master

- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
command: test
args: --all
env:
RUSTFLAGS: -C link-arg=-llapacke -C link-arg=-lcblas
toolchain: ${{ matrix.toolchain }}

- name: Run cargo test with BLAS enabled
run: cargo test --release --workspace --features intel-mkl-static,linfa-ica/blas,linfa-reduction/blas,linfa-linear/blas,linfa-preprocessing/blas,linfa-pls/blas,linfa-elasticnet/blas
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -32,3 +32,10 @@ poetry.lock
*.ipynb

*.json

# Generated artifacts of website (with Zola)
docs/website/public/*
docs/website/static/rustdocs/

# Downloaded data for the linfa-preprocessing benches
20news/
Loading