-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also update version numbers of binding Rust projects to match Regorus Signed-off-by: Anand Krishnamoorthi <[email protected]>
- Loading branch information
Showing
31 changed files
with
431 additions
and
116 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,37 @@ | ||
name: test-python | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: x64 | ||
|
||
- name: Build wheels | ||
uses: PyO3/maturin-action@63b75c597b83e247fbf4fb7719801cc4220ae9f3 # v1.43.0 | ||
with: | ||
target: x86_64 | ||
args: --release --out dist --manifest-path bindings/python/Cargo.toml | ||
sccache: 'true' | ||
|
||
- name: Test wheel | ||
run: | | ||
pip3 install dist/regorus-*.whl | ||
cd bindings/python | ||
python3 test.py |
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,43 @@ | ||
name: test-c-cpp | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup gcc, g++, cmake, ninja | ||
run: sudo apt update && sudo apt install -y gcc g++ cmake ninja-build | ||
|
||
- name: Test c binding | ||
run: | | ||
mkdir bindings/c/build | ||
cd bindings/c/build | ||
cmake -G Ninja .. | ||
ninja | ||
./regorus_test | ||
- name: Test c-nostd binding | ||
run: | | ||
mkdir bindings/c-nostd/build | ||
cd bindings/c-nostd/build | ||
cmake -G Ninja .. | ||
ninja | ||
./regorus_test | ||
- name: Test cpp binding | ||
run: | | ||
mkdir bindings/cpp/build | ||
cd bindings/cpp/build | ||
cmake -G Ninja .. | ||
ninja | ||
./regorus_test |
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,33 @@ | ||
name: test-java | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: 8 | ||
distribution: "corretto" | ||
- uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Building binding | ||
run: cargo build --release --manifest-path bindings/java/Cargo.toml | ||
- name: Build jar | ||
run: | | ||
cp ../../target/release/regorus*.so . | ||
mvn package | ||
working-directory: ./bindings/java | ||
- name: Test jar | ||
run: java -cp target/regorus-java-0.1.5.jar Test.java | ||
working-directory: ./bindings/java |
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,33 @@ | ||
name: musl | ||
|
||
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: Add musl target | ||
run: rustup target add x86_64-unknown-linux-musl | ||
- name: Install musl-gcc | ||
run: sudo apt update && sudo apt install -y musl-tools | ||
- name: Build (MUSL) | ||
run: cargo build --verbose --all-targets --target x86_64-unknown-linux-musl | ||
- name: Run tests (MUSL) | ||
run: cargo test -r --verbose --target x86_64-unknown-linux-musl | ||
- name: Run tests (MUSL ACI) | ||
run: cargo test -r --test aci --target x86_64-unknown-linux-musl | ||
- name: Run tests (KATA ACI) | ||
run: cargo test -r --test kata --target x86_64-unknown-linux-musl | ||
- name: Run tests (MUSL OPA Conformance) | ||
run: >- | ||
cargo test -r --test opa --features opa-testutil,serde_json/arbitrary_precision --target x86_64-unknown-linux-musl -- $(tr '\n' ' ' < tests/opa.passing) |
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,22 @@ | ||
name: build-no-std | ||
|
||
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: Add no_std target | ||
run: rustup target add thumbv7m-none-eabi | ||
run: cd tests/ensure_no_std && cargo build -r --target thumbv7m-none-eabi | ||
|
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,37 @@ | ||
name: test-python | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: x64 | ||
|
||
- name: Build wheels | ||
uses: PyO3/maturin-action@63b75c597b83e247fbf4fb7719801cc4220ae9f3 # v1.43.0 | ||
with: | ||
target: x86_64 | ||
args: --release --out dist --manifest-path bindings/python/Cargo.toml | ||
sccache: 'true' | ||
|
||
- name: Test wheel | ||
run: | | ||
pip3 install dist/regorus-*.whl | ||
cd bindings/python | ||
python3 test.py |
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,30 @@ | ||
name: test-wasm | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Install wasmlpack | ||
run: cargo install wasm-pack | ||
|
||
- name: Test wasm binding | ||
run: | | ||
cd bindings/wasm | ||
wasm-pack build --target nodejs --release | ||
node test.js |
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,37 @@ | ||
name: tests-debug | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build (all features) | ||
run: cargo build --all-features | ||
- name: Build | ||
run: cargo build | ||
- name: Test no_std | ||
run: cargo test --no-default-features | ||
- name: Build only std | ||
run: cargo build --example regorus --no-default-features --features "std" | ||
- name: Doc Tests | ||
run: cargo test --doc | ||
- name: Run tests | ||
run: cargo test | ||
- name: Run tests (ACI) | ||
run: cargo test --test aci | ||
- name: Run tests (KATA) | ||
run: cargo test --test kata | ||
- name: Run tests (OPA Conformance) | ||
run: >- | ||
cargo test --test opa --features opa-testutil,serde_json/arbitrary_precision -- $(tr '\n' ' ' < tests/opa.passing) |
Oops, something went wrong.