Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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"
34 changes: 22 additions & 12 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,11 @@ 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 @@ -114,20 +119,25 @@ jobs:

- name: Run cargo check tool to check if the `no_std` code are valid
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '--cfg getrandom_backend="unsupported"'
with:
command: check
args: --lib --no-default-features --features=full_no_std_platform_independent,mock_getrandom
args: --lib --no-default-features --features=full_no_std_platform_independent

- name: Run cargo check tool to check if the additional example code are valid
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: '--cfg getrandom_backend="custom"'
with:
command: check
args: --manifest-path examples/no_std/Cargo.toml --target thumbv7m-none-eabi

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"
19 changes: 9 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ contract_test = ["parse_token", "publish", "access", "crypto", "std", "subscribe
full_no_std = ["serde", "reqwest", "crypto", "parse_token", "blocking", "publish", "access", "subscribe", "tokio", "presence"]
full_no_std_platform_independent = ["serde", "crypto", "parse_token", "blocking", "publish", "access", "subscribe", "presence"]
pubnub_only = ["crypto", "parse_token", "blocking", "publish", "access", "subscribe", "presence"]
mock_getrandom = ["getrandom/custom"]
# TODO: temporary treated as internal until we officially release it
subscribe = ["dep:futures"]
presence = ["dep:futures"]
Expand All @@ -80,28 +79,28 @@ spin = "0.9"
phantom-type = { version = "0.4.2", default-features = false }
percent-encoding = { version = "2.1", default-features = false }
base64 = { version = "0.21", features = ["alloc"], default-features = false }
derive_builder = { version = "0.12", default-features = false }
derive_builder = { version = "0.12.0", default-features = false }
uuid = { version = "1.3", features = ["v4"], default-features = false }
snafu = { version = "0.7", features = ["rust_1_46"], default-features = false }
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 = { version = "1.0", features = ["derive", "alloc"], optional = true, 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
aes = { version = "0.8.2", optional = true }
cbc = { version = "0.1.2", optional = true }
getrandom = { version = "0.2", optional = true }
getrandom = { version = "0.3", optional = true }

# parse_token
ciborium = { version = "0.2.1", default-features = false, optional = true }
Expand All @@ -115,18 +114,18 @@ async-channel = { version = "1.8", optional = true }
portable-atomic = { version = "1.3", optional = true, default-features = false, features = ["require-cas", "critical-section"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.2", features = ["js"] }
getrandom = { version = "0.3", features = ["wasm_js"] }

[dev-dependencies]
async-trait = "0.1"
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"] }
getrandom = { version = "0.3" }

[build-dependencies]
built = "0.6"
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.3", default_features = false }

[[bin]]
name = "publish"
Expand Down
Loading
Loading