Skip to content

Use large GitHub runner #187

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions .github/workflows/commands-handler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 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@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Checkout release actions
if: steps.user-check.outputs.expected-user == 'true'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ on:
jobs:
check-release:
name: Check release required
runs-on: ubuntu-latest
if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true
runs-on:
group: Default
outputs:
release: ${{ steps.check.outputs.ready }}
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
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
needs: check-release
if: needs.check-release.outputs.release == 'true'
runs-on:
group: Default
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
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@v4
with:
repository: pubnub/client-engineering-deployment-tools
ref: v1
Expand Down
17 changes: 10 additions & 7 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: Default
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- 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: Default
steps:
- name: Checkout project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Checkout mock-server action
uses: actions/checkout@v3
uses: actions/checkout@v4
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: Default
steps:
- name: Tests summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed"
31 changes: 19 additions & 12 deletions .github/workflows/run-validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ env:
jobs:
# pubnub-yml:
# name: "Validate .pubnub.yml"
# runs-on: ubuntu-latest
# runs-on:
# group: Default Larger Runners
# labels: ubuntu-latest-m
# steps:
# - name: Checkout project
# uses: actions/checkout@v3
# uses: actions/checkout@v4
# - name: Checkout validator action
# uses: actions/checkout@v3
# uses: actions/checkout@v4
# with:
# repository: pubnub/client-engineering-deployment-tools
# ref: v1
Expand All @@ -40,9 +42,10 @@ jobs:

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

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

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

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

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

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

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

all-validations:
name: Validations
runs-on: ubuntu-latest
needs: [linters, cargo-deny, wasm-target, no_std-target]
runs-on:
group: Default
steps:
- name: Validations summary
run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed"
5 changes: 0 additions & 5 deletions examples/presence_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ struct State {
is_doing: String,
flag: bool,
}
#[derive(Debug, serde::Serialize)]
struct State2 {
is_doing: String,
business: String,
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn snafu::Error>> {
Expand Down
22 changes: 0 additions & 22 deletions src/core/event_engine/effect_dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ where
mod should {
use super::*;
use crate::core::event_engine::Event;
use std::future::Future;

struct TestEvent;

Expand Down Expand Up @@ -261,27 +260,6 @@ mod should {
}
}

#[derive(Clone)]
struct TestRuntime {}

#[async_trait::async_trait]
impl Runtime for TestRuntime {
fn spawn<R>(&self, _future: impl Future<Output = R> + Send + 'static)
where
R: Send + 'static,
{
// Do nothing.
}

async fn sleep(self, _delay: u64) {
// Do nothing.
}

async fn sleep_microseconds(self, _delay: u64) {
// Do nothing.
}
}

#[test]
fn create_not_managed_effect() {
let (_tx, rx) = async_channel::bounded::<TestInvocation>(5);
Expand Down
4 changes: 1 addition & 3 deletions src/core/retry_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,7 @@ impl RequestRetryConfiguration {
/// * `Some(delay_in_microseconds)` - The delay in microseconds.
/// * `None` - If `delay_in_seconds` is `None`.
fn delay_in_microseconds(delay_in_seconds: Option<u64>) -> Option<u64> {
let Some(delay_in_seconds) = delay_in_seconds else {
return None;
};
let delay_in_seconds = delay_in_seconds?;

const MICROS_IN_SECOND: u64 = 1_000_000;
let delay = delay_in_seconds * MICROS_IN_SECOND;
Expand Down
4 changes: 2 additions & 2 deletions src/dx/access/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ mod it_should {
response: None,
request_handler: Some(Box::new(|req| {
assert!(req.query_parameters.contains_key("timestamp"));
assert!(req.query_parameters.get("timestamp").is_some());
assert!(req.query_parameters.contains_key("timestamp"));
})),
};

Expand All @@ -368,7 +368,7 @@ mod it_should {
response: None,
request_handler: Some(Box::new(|req| {
assert!(req.query_parameters.contains_key("signature"));
assert!(req.query_parameters.get("signature").is_some());
assert!(req.query_parameters.contains_key("signature"));
assert!(req
.query_parameters
.get("signature")
Expand Down
2 changes: 1 addition & 1 deletion src/dx/presence/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ mod it_should {
response: None,
request_handler: Some(Box::new(|req| {
assert!(req.query_parameters.contains_key("state"));
assert!(req.query_parameters.get("state").is_some());
assert!(req.query_parameters.contains_key("state"));

let state = req.query_parameters.get("state").unwrap();
assert!(state.contains("channel_a"));
Expand Down
2 changes: 1 addition & 1 deletion src/dx/subscribe/event_engine/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl SubscribeState {
// Merge stored cursor with service-provided.
let mut next_cursor = next_cursor.clone();
if let Some(cursor) = cursor {
next_cursor.timetoken = cursor.timetoken.clone();
next_cursor.timetoken.clone_from(&cursor.timetoken);
}

Some(self.transition_to(
Expand Down
2 changes: 1 addition & 1 deletion src/dx/subscribe/subscription.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ where
.gt(current_cursor)
.then(|| *cursor_slot = Some(catchup_cursor));
} else {
*cursor_slot = cursor.clone();
cursor_slot.clone_from(&cursor);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dx/subscribe/subscription_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ where
if !event_handlers.is_empty() {
if let Some((_, handler)) = event_handlers.iter().next() {
if let Some(handler) = handler.upgrade().clone() {
client = handler.client().upgrade().clone();
client.clone_from(&handler.client().upgrade());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/dx/subscribe/subscription_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ where
.gt(current_cursor)
.then(|| *cursor_slot = Some(catchup_cursor));
} else {
*cursor_slot = cursor.clone();
cursor_slot.clone_from(&cursor);
}
}
}
Expand Down Expand Up @@ -1174,7 +1174,7 @@ mod it_should {
.into_iter()
.map(|name| client.channel(name).subscription(None))
.collect::<Vec<Subscription<_, _>>>();
let channels_3_subscriptions = vec![
let channels_3_subscriptions = [
channels_1_subscriptions[0].clone(),
channels_2_subscriptions[1].clone(),
];
Expand Down
Loading