-
Notifications
You must be signed in to change notification settings - Fork 175
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
[ci]: test each individual crate's manifest #392
Changes from 6 commits
e683cec
46b3ec5
b66e67b
433a617
be54762
8edee85
7e94aff
1a229d3
93a936b
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 |
---|---|---|
|
@@ -62,7 +62,7 @@ jobs: | |
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v1.3.0 | ||
|
||
- name: Cargo check all targets | ||
- name: Cargo check all targets (use Cargo.toml in workspace) | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
|
@@ -74,8 +74,68 @@ jobs: | |
command: check | ||
args: --manifest-path http-client/Cargo.toml --no-default-features --features tokio02 | ||
|
||
- name: Cargo check HTTP client | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path http-client/Cargo.toml | ||
|
||
- name: Cargo check HTTP server | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path http-server/Cargo.toml | ||
|
||
- name: Cargo check WS client | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path ws-client/Cargo.toml | ||
|
||
- name: Cargo check WS client with tokio02 | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path ws-client/Cargo.toml --no-default-features --features tokio02 | ||
|
||
- name: Cargo check WS server | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path ws-server/Cargo.toml | ||
|
||
- name: Cargo check types | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path types/Cargo.toml | ||
|
||
- name: Cargo check utils | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path utils/Cargo.toml | ||
|
||
- name: Cargo check proc macros | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path utils/Cargo.toml | ||
|
||
- name: Cargo check test utils | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path test-utils/Cargo.toml | ||
|
||
- name: Cargo check examples | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: check | ||
args: --manifest-path examples/Cargo.toml | ||
|
||
tests: | ||
name: Run tests | ||
name: Run tests Ubuntu | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
|
@@ -101,3 +161,59 @@ jobs: | |
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: test | ||
|
||
tests_macos: | ||
name: Run tests macos | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2.3.4 | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1.0.7 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v1.3.0 | ||
niklasad1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Cargo build | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: build | ||
args: --workspace | ||
Comment on lines
+182
to
+186
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 we need to have a build step before the 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. no you are right, we don't have too but the previous checks only run 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. My first thought was that |
||
|
||
- name: Cargo test | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: test | ||
|
||
tests_windows: | ||
name: Run tests Windows | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2.3.4 | ||
|
||
- name: Install Rust stable toolchain | ||
uses: actions-rs/toolchain@v1.0.7 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Rust Cache | ||
uses: Swatinem/rust-cache@v1.3.0 | ||
|
||
- name: Cargo build | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: build | ||
args: --workspace | ||
|
||
- name: Cargo test | ||
uses: actions-rs/cargo@v1.0.3 | ||
with: | ||
command: test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ documentation = "https://docs.rs/jsonrpsee-ws-server" | |
[dependencies] | ||
thiserror = "1" | ||
futures-channel = "0.3.14" | ||
futures-util = { version = "0.3.14", default-features = false, features = ["io"] } | ||
futures-util = { version = "0.3.14", default-features = false, features = ["io", "async-await-macro"] } | ||
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. Nit: It doesn't look like we've added any code that requires this feature; do we want it? 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. This fixes the crate to "compile" standalone i.e, outside the workspace. It was introduced in another PR, thus it doesn't compile standalone such as if you would do TLDR; on master 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. Aah gotcha! Thanks for the explanation! |
||
jsonrpsee-types = { path = "../types", version = "0.2.0" } | ||
jsonrpsee-utils = { path = "../utils", version = "0.2.0", features = ["server"] } | ||
log = "0.4" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,8 +173,6 @@ async fn can_set_max_connections() { | |
assert!(conn3.is_err()); | ||
let err = conn3.unwrap_err(); | ||
assert!(err.to_string().contains("WebSocketHandshake failed")); | ||
assert!(err.to_string().contains("Connection reset by peer")); | ||
// Err(Io(Os { code: 54, kind: ConnectionReset, message: \"Connection reset by peer\" }))"); | ||
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. so let's remove the assertion it would be better if we used |
||
|
||
// Decrement connection count | ||
drop(conn2); | ||
|
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.
Instead of checking every crate individually, could we just run
cargo check
without arguments? My experience is that that checks every crate in the workspace by default (though you can also add--workspace
to, I assume, be sure).Or do we need to check individually because
http-client
needs thetokio02
feature setting?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.
yeah, we did do
cargo check --workspace
before this PR but that's the problem and why I addedcargo check --manifest-path crate
, see my comment below.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.
Thanks, that all makes sense now :)