-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(capi): Move CAPI generation to its own crate #234
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aac6a47
refactor(capi): Move CAPI generation to its own crate
ptondereau dbaecbb
reduce Biscuit visibility
ptondereau 90a2180
remove capi.rs
ptondereau 00dfed0
add `print_block_source` c binding
ptondereau 4bb076c
add test for `biscuit_print_block_source` + use `inttypes.h` macros f…
ptondereau 08f7900
remove `block()` usage and C-API usage
ptondereau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,69 +2,50 @@ name: Rust | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
pull_request: | ||
branches: [ main, v5 ] | ||
branches: [main, v5] | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo | ||
target/ | ||
key: ${{ runner.os }}-${{ hashFiles('Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ hashFiles('Cargo.toml') }} | ||
${{ runner.os }}- | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --features="serde-error,bwk" --verbose | ||
- name: Check samples | ||
run: | | ||
cd biscuit-auth | ||
cargo run --release --example testcases --features serde-error -- ./samples --json > ./samples/samples.json | ||
git diff --exit-code | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo | ||
target/ | ||
key: ${{ runner.os }}-${{ hashFiles('Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ hashFiles('Cargo.toml') }} | ||
${{ runner.os }}- | ||
- name: Build | ||
run: cargo build --verbose | ||
- name: Run tests | ||
run: cargo test --features="serde-error,bwk" --verbose | ||
- name: Check samples | ||
run: | | ||
cd biscuit-auth | ||
cargo run --release --example testcases --features serde-error -- ./samples --json > ./samples/samples.json | ||
git diff --exit-code | ||
|
||
capi: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo | ||
target/ | ||
key: ${{ runner.os }}-cargoc-${{ hashFiles('Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargoc-${{ hashFiles('Cargo.toml') }} | ||
${{ runner.os }}-cargoc- | ||
${{ runner.os }}-${{ hashFiles('Cargo.toml') }} | ||
${{ runner.os }}- | ||
- name: Install cargo-c | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: install | ||
args: cargo-c --version 0.9.14+cargo-0.66 | ||
- name: Run cargo-c tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: ctest | ||
args: --release | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
- uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Install cargo-c | ||
run: cargo install cargo-c --version 0.10.5+cargo-0.83.0 | ||
- name: Run cargo-c tests | ||
run: cargo ctest --features="capi" --release | ||
|
||
coverage: | ||
name: Coverage | ||
|
@@ -94,4 +75,4 @@ jobs: | |
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: biscuit-auth/biscuit-rust | ||
slug: biscuit-auth/biscuit-rust |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[workspace] | ||
members = ["biscuit-auth", "biscuit-quote", "biscuit-parser"] | ||
members = ["biscuit-auth", "biscuit-quote", "biscuit-parser", "biscuit-capi"] |
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,30 @@ | ||
[package] | ||
name = "biscuit-capi" | ||
version = "5.0.0" # Should keep the same version as biscuit-auth | ||
description = "C API for Biscuit" | ||
authors = ["Geoffroy Couprie <[email protected]>"] | ||
edition = "2018" | ||
license = "Apache-2.0" | ||
documentation = "https://docs.rs/biscuit-auth" | ||
homepage = "https://github.com/biscuit-auth/biscuit" | ||
repository = "https://github.com/biscuit-auth/biscuit-rust" | ||
|
||
[dependencies] | ||
biscuit-auth = { version = "5.0.0", path = "../biscuit-auth", features = [ | ||
"datalog-macro", | ||
"serde-error", | ||
] } | ||
inline-c = { version = "0.1", optional = true } | ||
rand = "0.8" | ||
|
||
[features] | ||
default = [] | ||
capi = ["inline-c"] | ||
|
||
[package.metadata.capi.library] | ||
# Used as the library name and defaults to the crate name. This might get | ||
# prefixed with `lib` depending on the target platform. | ||
name = "biscuit_auth" | ||
|
||
[package.metadata.capi.header] | ||
name = "biscuit_auth" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't backported this, if someone has a clue on what's the purpose of
include
config