Skip to content
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

chore(CI): maximize disk space #906

Merged
merged 8 commits into from
Oct 31, 2024
Merged
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
10 changes: 5 additions & 5 deletions .github/actions/style/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:
shell: bash
run: |
echo "Checking for Markdown/MDX changes..."
if echo "$ALL_CHANGED_FILES" | grep -qE '\.mdx?$'; then
if true || echo "$ALL_CHANGED_FILES" | grep -qE '\.mdx?$'; then
if ! pnpm check:md; then
echo "Markdown or MDX files are not properly formatted."
exit 1 # Exit with a non-zero status code to indicate failure
Expand All @@ -28,10 +28,10 @@ runs:
shell: bash
run: |
echo "Checking for Rust code changes..."
if echo "$ALL_CHANGED_FILES" | grep -q '\.rs$'; then
if true || echo "$ALL_CHANGED_FILES" | grep -q '\.rs$'; then
echo "Running checks for the Rust code..."

# Install the nightly toolchain
# Install the nightly toolchain
rustup toolchain install nightly

# Install rustfmt for the nightly toolchain
Expand All @@ -54,7 +54,7 @@ runs:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Checking for changes in node-ui files"
if echo "$ALL_CHANGED_FILES" | grep -q '^node-ui/'; then
if true || echo "$ALL_CHANGED_FILES" | grep -q '^node-ui/'; then
echo "Running checks for the node-ui..."
cd node-ui
if ! pnpm prettier:check .; then
Expand All @@ -75,7 +75,7 @@ runs:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "Checking for changes in calimero-sdk files"
if echo "$ALL_CHANGED_FILES" | grep -q '^packages/calimero-sdk/'; then
if true || echo "$ALL_CHANGED_FILES" | grep -q '^packages/calimero-sdk/'; then
echo "Running checks for the calimero-sdk files"
cd packages/calimero-sdk
if ! pnpm prettier:check .; then
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,84 @@ jobs:
name: Project setup
runs-on: ubuntu-latest
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 4096

- name: Checkout code
uses: actions/checkout@v4

- name: How're we looking?
run: |
df -h

# Install Node.js (version 20) and pnpm
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: How're we looking?
run: |
df -h

- name: Install pnpm
run: npm install -g pnpm

- name: How're we looking?
run: |
df -h

# Install and build node-ui
- name: Install node-ui dependencies with pnpm
run: pnpm install --prefix ./node-ui

- name: How're we looking?
run: |
df -h

- name: Build node-ui
run: pnpm --filter ./node-ui run build

- name: How're we looking?
run: |
df -h

- name: Setup rust toolchain
run: rustup toolchain install stable --profile minimal

- name: How're we looking?
run: |
df -h

- name: Setup rust cache
uses: Swatinem/rust-cache@v2

- name: How're we looking?
run: |
df -h

- name: Run code style checks
uses: ./.github/actions/style

- name: How're we looking?
run: |
df -h

- name: Build
run: cargo build --verbose

- name: How're we looking?
run: |
df -h

- name: Run tests
run: |
chmod +x $GITHUB_WORKSPACE/scripts/build-all-apps.sh
chmod +x $GITHUB_WORKSPACE/scripts/test.sh
$GITHUB_WORKSPACE/scripts/test.sh

- name: How're we looking?
run: |
df -h
27 changes: 16 additions & 11 deletions packages/calimero-sdk/src/subscriptions/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ export interface SubscriptionsClient {
disconnect(connectionId?: string): void;
subscribe(contextIds: string[], connectionId?: string): void;
unsubscribe(contextIds: string[], connectionId?: string): void;
addCallback(callback: (event: NodeEvent) => void, connectionId?: string): void;
addCallback(
callback: (event: NodeEvent) => void,
connectionId?: string,
): void;
removeCallback(
callback: (event: NodeEvent) => void,
connectionId?: string,
Expand All @@ -16,21 +19,23 @@ export type NodeEvent = ContextEvent;

export type ContextEvent = ContextEventPayload & {
contextId: ContextId;
}

type ContextEventPayload = {
type: 'StateMutation',
data: StateMutation,
} | {
type: 'ExecutionEvent',
data: ExecutionEvent,
};

type ContextEventPayload =
| {
type: 'StateMutation';
data: StateMutation;
}
| {
type: 'ExecutionEvent';
data: ExecutionEvent;
};

export interface StateMutation {
newRoot: string;
}

export interface ExecutionEvent {
kind: string,
data: any,
kind: string;
data: any;
}
Loading