-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from s-simoncelli/add-ci
Added CI
- Loading branch information
Showing
26 changed files
with
281 additions
and
136 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
name: Check and Lint | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
fmt: | ||
name: Rustfmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
- run: rustup component add rustfmt | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
clippy: | ||
name: Clippy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: clippy | ||
override: true | ||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features | ||
name: Clippy Output |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build and test | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test-linux: | ||
name: Cargo check and test on Unix systems | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Enable this when testing with nektos/act | ||
# - uses: actions-rs/toolchain@v1 | ||
# with: | ||
# toolchain: stable | ||
# override: true | ||
# - name: Install Clang | ||
# run: sudo apt update && sudo apt install --yes clang | ||
- uses: actions/checkout@v4 | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --verbose | ||
# NOTE disabled due to compiler failure in hv-fonseca crate | ||
# test-windows: | ||
# name: Cargo check and test on Windows | ||
# runs-on: windows-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Build | ||
# run: cargo build --verbose | ||
# - name: Run tests | ||
# run: cargo test --verbose |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use optirustic::core::OError; | ||
use optirustic::utils::DasDarren1998; | ||
|
||
/// Generate and plot reference points using the Ds & Darren (1998) method. | ||
fn main() -> Result<(), OError> { | ||
// Consider the case of a 3D hyperplane with 3 objectives | ||
let number_of_objectives = 3; | ||
// Each objective axis is split into 5 gaps of equal size. | ||
let number_of_partitions = 5; | ||
|
||
let m = DasDarren1998::new(number_of_objectives, number_of_partitions); | ||
// This returns the coordinates of the reference points between 0 and 1 | ||
println!("Total pints = {:?}", m.number_of_points()); | ||
|
||
let weights = m.get_weights(); | ||
println!("Weights = {:?}", weights); | ||
|
||
// Save the charts of points to inspect them | ||
m.plot("ref_points_3obj_5gaps.png") | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.