Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/commands-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Commands processor

on:
issue_comment:
types: [created]
types: [ created ]
defaults:
run:
shell: bash
Expand All @@ -11,7 +11,8 @@ jobs:
process:
name: Process command
if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true
runs-on: ubuntu-latest
runs-on:
group: organization/Default
steps:
- name: Check referred user
id: user-check
Expand All @@ -23,12 +24,12 @@ jobs:
run: echo -e "\033[38;2;19;181;255mThis is regular commit which should be ignored.\033[0m"
- name: Checkout repository
if: steps.user-check.outputs.expected-user == 'true'
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
token: ${{ secrets.GH_TOKEN }}
- name: Checkout release actions
if: steps.user-check.outputs.expected-user == 'true'
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ name: Automated product release

on:
pull_request:
branches: [master]
types: [closed]
branches: [ master ]
types: [ closed ]

jobs:
check-release:
name: Check release required
runs-on: ubuntu-latest
runs-on:
group: organization/Default
if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true
outputs:
release: ${{ steps.check.outputs.ready }}
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
Expand All @@ -27,18 +28,19 @@ jobs:
token: ${{ secrets.GH_TOKEN }}
publish:
name: Publish package
runs-on: ubuntu-latest
runs-on:
group: organization/Default
needs: check-release
if: needs.check-release.outputs.release == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
# This should be the same as the one specified for on.pull_request.branches
ref: master
token: ${{ secrets.GH_TOKEN }}
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ env:
jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest
runs-on:
group: organization/Default
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v5
- name: Run unit tests
run: |
cargo test --features="full"
Expand All @@ -34,12 +35,13 @@ jobs:
# uses: ./.github/.release/actions/actions/utils/fast-jobs-failure
acceptance-tests:
name: Acceptance tests
runs-on: ubuntu-latest
runs-on:
group: organization/Default
steps:
- name: Checkout project
uses: actions/checkout@v3
uses: actions/checkout@v5
- name: Checkout mock-server action
uses: actions/checkout@v3
uses: actions/checkout@v5
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
Expand All @@ -56,15 +58,16 @@ jobs:
run: |
cargo test --features contract_test --test contract_test
- name: Expose acceptance tests reports
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: acceptance-test-reports
path: tests/reports/*.xml
retention-days: 7
all-tests:
name: Tests
runs-on: ubuntu-latest
needs: [tests, acceptance-tests]
runs-on:
group: organization/Default
needs: [ tests, acceptance-tests ]
steps:
- name: Tests summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
27 changes: 16 additions & 11 deletions .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ jobs:

linters:
name: Launch all cargo linters to check condition of the code
runs-on: ubuntu-latest
runs-on:
group: organization/Default
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Run cargo check tool to check if the code are valid
run: |
Expand All @@ -68,7 +69,8 @@ jobs:

cargo-deny:
name: Check Cargo crate dependencies
runs-on: ubuntu-latest
runs-on:
group: organization/Default
strategy:
matrix:
checks:
Expand All @@ -77,16 +79,17 @@ jobs:
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
- uses: actions/checkout@v5
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check ${{ matrix.checks }}

wasm-target:
name: Check if Web Assembly target compiles as expected
runs-on: ubuntu-latest
runs-on:
group: organization/Default
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Install WASM target
uses: actions-rs/toolchain@v1
Expand All @@ -102,9 +105,10 @@ jobs:

no_std-target:
name: Check if `no_std` target compiles as expected
runs-on: ubuntu-latest
runs-on:
group: organization/Default
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Install `no_std` target
uses: actions-rs/toolchain@v1
Expand All @@ -126,8 +130,9 @@ jobs:

all-validations:
name: Validations
runs-on: ubuntu-latest
needs: [linters, cargo-deny, wasm-target, no_std-target]
runs-on:
group: organization/Default
needs: [ linters, cargo-deny, wasm-target, no_std-target ]
steps:
- name: Validations summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed"
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ rand = { version = "0.8.5", default-features = false }

# signature
hmac = "0.12"
sha2 = {version = "0.10", default-features = false }
sha2 = { version = "0.10", default-features = false }
time = { version = "0.3", features = ["alloc"], default-features = false }

# serde
serde = { version = "1.0", features = ["derive"], optional = true, default-features = false }
serde_json = { version = "1.0", optional = true, features = ["alloc"] ,default-features = false }
serde_json = { version = "1.0", optional = true, features = ["alloc"], default-features = false }

# reqwest
reqwest = { version = "0.11", optional = true }
reqwest = { version = "0.12", optional = true }
bytes = { version = "1.4", default-features = false, optional = true }

# crypto
Expand Down Expand Up @@ -123,7 +123,7 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros", "time"] }
wiremock = "0.5"
env_logger = "0.10"
cucumber = { version = "0.20.2", features = ["output-junit"] }
reqwest = { version = "0.11", features = ["json"] }
reqwest = { version = "0.12", features = ["json"] }
test-case = "3.0"
hashbrown = { version = "0.14.0", features = ["serde"] }
getrandom = { version = "0.2", features = ["custom"] }
Expand Down
20 changes: 8 additions & 12 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# Root options
[graph]
targets = [
#{ triple = "x86_64-unknown-linux-musl" },
]
all-features = false
no-default-features = false

[output]
feature-depth = 1

# This section is considered when running `cargo deny check advisories`
# More documentation for the advisories section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html
[advisories]
version = 2
db-path = "~/.cargo/advisory-db"
db-urls = ["https://github.com/rustsec/advisory-db"]
vulnerability = "deny"
unmaintained = "warn"
unmaintained = "workspace"
yanked = "warn"
notice = "warn"
ignore = [
#"RUSTSEC-0000-0000",
]
Expand All @@ -24,7 +25,7 @@ ignore = [
# More documentation for the licenses section can be found here:
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
[licenses]
unlicensed = "deny"
version = 2
allow = [
# Before inserting a new license here, please check if it is already in the list of
# licenses that are allowed: https://blueoakcouncil.org/list
Expand All @@ -33,15 +34,10 @@ allow = [
"Apache-2.0",
"BlueOak-1.0.0",
"Unicode-DFS-2016",
"Unicode-3.0",
"BSD-3-Clause",
#"Apache-2.0 WITH LLVM-exception",
]
deny = [
#"Nokia",
]
copyleft = "warn"
allow-osi-fsf-free = "neither"
default = "deny"
confidence-threshold = 0.8
exceptions = [
{ allow = ["LicenseRef-PubNub-Software-Development-Kit-License"], name = "pubnub" },
Expand All @@ -52,7 +48,7 @@ exceptions = [
[[licenses.clarify]]
name = "pubnub"
expression = "LicenseRef-PubNub-Software-Development-Kit-License"
license-files = [ { path = "LICENSE", hash = 0x48826f13 }, ]
license-files = [{ path = "LICENSE", hash = 0x48826f13 }, ]


[licenses.private]
Expand Down
6 changes: 3 additions & 3 deletions examples/no_std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
pubnub = { path = "../../", default_features = false, features = ["blocking", "serde", "publish", "subscribe", "presence"] }
serde = { version = "1.0", default_features = false, features = ["derive"] }
getrandom = { version = "0.2", default_features = false, features = ["custom"] }
pubnub = { path = "../../", default-features = false, features = ["blocking", "serde", "publish", "subscribe", "presence"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
getrandom = { version = "0.2", default-features = false, features = ["custom"] }

[[bin]]
name = "publish"
Expand Down
2 changes: 2 additions & 0 deletions examples/presence_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ struct State {
is_doing: String,
flag: bool,
}

#[allow(dead_code)]
#[derive(Debug, serde::Serialize)]
Comment thread
parfeon marked this conversation as resolved.
Outdated
struct State2 {
is_doing: String,
Expand Down
12 changes: 12 additions & 0 deletions examples/subscribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ struct Message {

#[tokio::main]
async fn main() -> Result<(), Box<dyn snafu::Error>> {
env_logger::init();
let publish_key = env::var("SDK_PUB_KEY")?;
let subscribe_key = env::var("SDK_SUB_KEY")?;

Expand Down Expand Up @@ -104,6 +105,17 @@ async fn main() -> Result<(), Box<dyn snafu::Error>> {
.files_stream()
.for_each(|file| async move { println!("(b) file: {:?}", file) }),
);
// tokio::time::sleep(tokio::time::Duration::from_secs(2)).await;
println!("\nWaiting for message");
//
// println!("\nPublish a message:");
//
// pubnub
// .publish_message("{\"event\":\"flag_changed\",\"timestamp\":
// 1758130367173}") .channel("my_channel")
// .execute()
// .await?;
// println!("\nDone!");
Comment thread
parfeon marked this conversation as resolved.
Outdated

// Sleep for a minute. Now you can send messages to the channels
// "my_channel" and "other_channel" and see them printed in the console.
Expand Down
3 changes: 1 addition & 2 deletions src/core/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ impl<T, D> Channel<T, D> {
/// > features are enabled.
///
/// > As long as entity used by at least one subscription it can't be
/// > removed from subscription
/// loop.
/// > removed from subscription loop.
#[cfg(all(feature = "subscribe", feature = "std"))]
pub(crate) fn decrease_subscriptions_count(&self) {
let mut subscriptions_count_slot = self.subscriptions_count.write();
Expand Down
3 changes: 1 addition & 2 deletions src/core/channel_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ impl<T, D> ChannelGroup<T, D> {
/// > features are enabled.
///
/// > As long as entity used by at least one subscription it can't be
/// > removed from subscription
/// loop.
/// > removed from subscription loop.
#[cfg(all(feature = "subscribe", feature = "std"))]
pub(crate) fn decrease_subscriptions_count(&self) {
let mut subscriptions_count_slot = self.subscriptions_count.write();
Expand Down
3 changes: 1 addition & 2 deletions src/core/channel_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ impl<T, D> ChannelMetadata<T, D> {
/// > features are enabled.
///
/// > As long as entity used by at least one subscription it can't be
/// > removed from subscription
/// loop.
/// > removed from subscription loop.
#[cfg(all(feature = "subscribe", feature = "std"))]
pub(crate) fn decrease_subscriptions_count(&self) {
let mut subscriptions_count_slot = self.subscriptions_count.write();
Expand Down
3 changes: 1 addition & 2 deletions src/core/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ impl<T, D> PubNubEntity<T, D> {
/// > features are enabled.
///
/// > As long as entity used by at least one subscription it can't be
/// > removed from subscription
/// loop.
/// > removed from subscription loop.
#[cfg(all(feature = "subscribe", feature = "std"))]
pub(crate) fn decrease_subscriptions_count(&self) {
match self {
Expand Down
1 change: 1 addition & 0 deletions src/core/event_engine/effect_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ mod should {
}
}

#[allow(dead_code)]
Comment thread
parfeon marked this conversation as resolved.
Outdated
#[derive(Clone)]
struct TestRuntime {}

Expand Down
2 changes: 1 addition & 1 deletion src/core/event_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ where
/// Stop state machine using specific invocation.
///
/// > Note: Should be provided effect information which respond with `true`
/// for `is_terminating` method call.
/// > for `is_terminating` method call.
pub fn stop(&self, invocation: EI) {
{
*self.active.write() = false;
Expand Down
Loading
Loading