-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Still need to add more tests Update Cargo.toml; add README Switch yp_string_t_type variants to SNAKE_CASE Add unescape tests Add encoding callback tests Add pack_parse test Add diagnostic test Add comment test Add node tests Add string_list tests Add other string tests Add shared string test Add list tests Fixes for updated branch Run bundle install before running Rust tests Fix version test ci: Add proper config for rust-toolchain step for sanitizers ci: Fix tests, clippy Remove extra `bundle install`; run `bundle exec rake` Didn't realize `setup-ruby`'s `bundle-cache: true` runs `bundle install`. Remove `rake compile` from build.rs This is complicating CI for me; maybe we add it back later. Undo README formatting changes Fix UB in C callbacks Use slice+str instead of String for raw things Move bindings to bindings module Handle non-UTF-8 strings in paths rust ci: test with sanitizers; add -D warnings Update rust-bindings.yml Update Cargo.toml Don't need to compile extra crate_types PR changes
- Loading branch information
1 parent
8e764d1
commit 38957b1
Showing
16 changed files
with
1,307 additions
and
1 deletion.
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,101 @@ | ||
--- | ||
name: Rust Bindings | ||
|
||
on: | ||
push: | ||
paths: | ||
- ".github/workflows/rust-bindings.yml" | ||
- "include/" | ||
- "src/" | ||
- "rust/" | ||
- "*akefile*" | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
RUSTFLAGS: "-D warnings" | ||
|
||
jobs: | ||
cargo-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: head | ||
bundler-cache: true | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }} | ||
${{ runner.os }}-cargo | ||
- name: rake compile | ||
run: bundle exec rake compile | ||
- name: cargo test | ||
working-directory: rust/yarp-sys | ||
run: cargo test | ||
|
||
cargo-clippy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: head | ||
bundler-cache: true | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml') }} | ||
${{ runner.os }}-cargo | ||
- name: rake compile | ||
run: bundle exec rake compile | ||
- name: cargo clippy | ||
working-directory: rust/yarp-sys | ||
run: cargo clippy --tests -- -W "clippy::pedantic" | ||
|
||
sanitizer-test: | ||
name: Test with -Zsanitizer=${{ matrix.sanitizer }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sanitizer: [address, leak] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: head | ||
bundler-cache: true | ||
- name: rake compile | ||
run: bundle exec rake compile | ||
- uses: dtolnay/rust-toolchain@nightly | ||
with: | ||
target: "x86_64-unknown-linux-gnu" | ||
components: "rust-src" | ||
- name: Test with sanitizer | ||
env: | ||
RUSTFLAGS: -Zsanitizer=${{ matrix.sanitizer }} | ||
RUSTDOCFLAGS: -Zsanitizer=${{ matrix.sanitizer }} | ||
# only needed by asan | ||
ASAN_OPTIONS: detect_stack_use_after_return=1 | ||
# Asan's leak detection occasionally complains | ||
# about some small leaks if backtraces are captured, | ||
# so ensure they're not | ||
RUST_BACKTRACE: 0 | ||
working-directory: rust/yarp-sys | ||
run: cargo test -Zbuild-std --verbose --target=x86_64-unknown-linux-gnu |
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ task :check_manifest => [:templates] do | |
java | ||
pkg | ||
rakelib | ||
rust | ||
templates | ||
test | ||
tmp | ||
|
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 @@ | ||
/target/ |
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,9 @@ | ||
# will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb |
Oops, something went wrong.