-
Notifications
You must be signed in to change notification settings - Fork 16
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
Github Actions #26
Github Actions #26
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: SDK Rust CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
test: | ||
name: cargo test | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
rust: [stable, nightly] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Curious why you chose the nightly build? What do you think about removing? It would cut the testing by half :P There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Every six weeks, nightly is brought into a beta. Then six weeks after the first beta is released, a new stable release is made: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html I'm not opposed to removing, but I have heard that open source developers may be more inclined to use nightly for various reasons. Happy to remove though if we wanted to save resources. |
||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Rust | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
- name: Test | ||
run: cargo test --workspace | ||
Comment on lines
+28
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think it's worth adding a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went ahead and did a little digging here to find out the specifics:
Our upcoming bindings code will rely on artifacts generated via |
||
format: | ||
name: cargo fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Rustfmt | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
toolchain: stable | ||
components: rustfmt | ||
- name: Rustfmt Check | ||
id: rustfmt-check | ||
uses: actions-rust-lang/rustfmt@v1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,11 +145,11 @@ pub enum Optionality { | |
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
use serde_canonical_json::CanonicalFormatter; | ||
use serde_json::Serializer; | ||
use serde_json::{json, Value}; | ||
use std::fs; | ||
use std::path::Path; | ||
use serde_json::Serializer; | ||
use serde_canonical_json::CanonicalFormatter; | ||
|
||
#[test] | ||
fn can_serialize() { | ||
|
@@ -191,7 +191,8 @@ mod tests { | |
let json_value = String::from_utf8(ser.into_inner()).unwrap(); | ||
|
||
let mut ser = Serializer::with_formatter(Vec::new(), CanonicalFormatter::new()); | ||
let deserialized_with_type: PresentationDefinition = serde_json::from_str(&raw_string).unwrap(); | ||
let deserialized_with_type: PresentationDefinition = | ||
serde_json::from_str(&raw_string).unwrap(); | ||
Comment on lines
+194
to
+195
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rustfmt for the win! 💪 |
||
deserialized_with_type.serialize(&mut ser).unwrap(); | ||
let json_serialized_from_type = String::from_utf8(ser.into_inner()).unwrap(); | ||
|
||
|
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.
We haven't really targeted windows in other repos. It also turns out to be pretty slow. Do you think it's worth adding?
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.
Currently only take a few seconds longer than macos, so figured it would be fine to have. I'm fine removing though if people don't think it's worth it.
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.
We are running Windows for Bundler Bonanza Electron apps: https://github.com/TBD54566975/bundler-bonanza/blob/main/.github/workflows/tests-runner.yml#L241
Rationale: anticipating build issues for windows developers...