diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7863734..257a713 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,32 +23,7 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build - run: make build - - build-python-bindings: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: Swatinem/rust-cache@v2 - - - name: Build - run: make python-binding-release - - build-wasm-bindings: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - uses: Swatinem/rust-cache@v2 - - - name: install wasm-pack - run: cargo install wasm-pack - - - name: Build - run: make wasm-binding-release + run: cargo build --workspace test-all: runs-on: ubuntu-latest @@ -66,4 +41,24 @@ jobs: env: RSCEL_TEST_PROTO: 1 + deploy: + runs-on: ubuntu-latest + needs: test-all + if: success() && github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v3 + + - uses: Swatinem/rust-cache@v2 + + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: login to crates.io + run: cargo login ${{ secrets.CRATES_IO_API_KEY }} + + - name: publish + run: cargo publish -p rscel --dry-run + diff --git a/rscel/src/tests/general_tests.rs b/rscel/src/tests/general_tests.rs index 9e6e925..0b5fe0a 100644 --- a/rscel/src/tests/general_tests.rs +++ b/rscel/src/tests/general_tests.rs @@ -141,6 +141,9 @@ fn test_contains() { #[test_case(r#""\X48""#, "H".into(); "Test hex escape upper")] #[test_case("'fooBaR'.endsWithI('bar')", true.into(); "Test endsWithI")] #[test_case("'FoObar'.startsWithI('foo')", true.into(); "Test startsWithI")] +#[test_case("' foo '.trim()", "foo".into(); "Test trim")] +#[test_case("' foo '.trim_start()", "foo ".into(); "Test trim_start")] +#[test_case("' foo '.trim_end()", " foo".into(); "Test trim_end")] fn test_equation(prog: &str, res: CelValue) { let mut ctx = CelContext::new(); let exec_ctx = BindContext::new(); diff --git a/wasm/src/into_jsvalue.rs b/wasm/src/into_jsvalue.rs index 2261f2e..e4c6b32 100644 --- a/wasm/src/into_jsvalue.rs +++ b/wasm/src/into_jsvalue.rs @@ -1,6 +1,6 @@ use wasm_bindgen::JsValue; -use rscel::{CelError, CelValue, ProgramDetails}; +use rscel::{CelError, CelValue}; use crate::{eval_error::WasmCelError, from_jsvalue::WasmCelValue};