Skip to content

Commit

Permalink
add github action workflow. wip to update test_no_std.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlogan03 committed Nov 6, 2023
1 parent 111165d commit d0f19c7
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
# Check for updates every Monday
schedule:
interval: "weekly"
updates:
- package-ecosystem: "cargo"
directory: "/interpn"
# Check for updates every Monday
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Format
run: cd interpn; cargo fmt --check --verbose
- name: Lint
run: cd interpn; cargo clippy
- name: Build
run: cd interpn; cargo build --verbose
- name: Run tests
run: cd interpn; cargo test --verbose
- name: Test no-std
run: |
cd test_no_std
rustup target add thumbv7em-none-eabihf
rustup toolchain install nightly
cargo +nightly build --verbose
2 changes: 1 addition & 1 deletion test_no_std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
strobe = { path="../strobe", default-features = false }
interpn = { path="../interpn", default-features = false }
# panic-never = "0.1.0"

[profile.dev]
Expand Down
26 changes: 21 additions & 5 deletions test_no_std/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use core::panic::PanicInfo;

use interpn::*;
use interpn::{multilinear_rectilinear, multilinear_regular};

#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
Expand All @@ -15,11 +15,27 @@ fn panic(_info: &PanicInfo) -> ! {

#[no_mangle]
pub fn _start() -> ! {
// let a = [1.0_f64, 2.0, 3.0, 4.0];
// let b = [1.0_f64, 2.0, 3.0, 4.0];
// let mut c = [0.0; 4];
let x = [1.0_f64, 2.0];
let y = [1.0_f64, 2.0];

// add(&mut array(&a), &mut array(&b)).eval_into_slice(&mut c);
let mut z = [2.0; 4];

let mut out = [0.0; 4];

let dims = [nx, ny];
let starts = [x[0], y[0]];
let steps = [1.0, 1.0];

let xy = [0.0, 0.0];

multilinear_regular::interpn(
&xy[..],
&mut out[..],
&z[..],
&dims[..],
&starts[..],
&steps[..],
);

loop {} // We don't actually run this, just compile it
}

0 comments on commit d0f19c7

Please sign in to comment.