-
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
417 additions
and
104 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
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: bindings/c-cpp | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
test: | ||
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: bindings/go | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
architecture: x64 | ||
|
||
- name: Build ffi | ||
run: cargo build -r | ||
working-directory: ./bindings/ffi | ||
|
||
- name: Test go | ||
run: | | ||
go mod tidy | ||
go build | ||
LD_LIBRARY_PATH=../../target/release ./regorus_test | ||
working-directory: ./bindings/go |
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: bindings/java | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
test: | ||
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: mvn package | ||
working-directory: ./bindings/java | ||
|
||
- name: Test jar | ||
run: java -Djava.library.path=../../target/release -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: | ||
test: | ||
|
||
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,24 @@ | ||
name: bindings/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 | ||
- name: Build | ||
run: cargo build -r --target thumbv7m-none-eabi | ||
working-directory: ./tests/ensure_no_std | ||
|
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: bindings/python | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
PYTHON_VERSION: "3.10" | ||
|
||
jobs: | ||
test: | ||
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: bindings/wasm | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
test: | ||
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 |
Oops, something went wrong.