From 36ecf912b52f4828911c2d6ea34f83123fa2cfe7 Mon Sep 17 00:00:00 2001 From: Sandi Fatic Date: Thu, 31 Oct 2024 13:39:23 +0000 Subject: [PATCH] Revert "chore(CI): maximize disk space (#906)" This reverts commit bffe493f87f4dbf6c218cf566731876a74d0ac9a. --- .github/actions/style/action.yml | 10 ++--- .github/workflows/rust.yml | 45 ------------------- .../src/subscriptions/subscriptions.ts | 27 +++++------ 3 files changed, 16 insertions(+), 66 deletions(-) diff --git a/.github/actions/style/action.yml b/.github/actions/style/action.yml index fa09c7911..e81a9315d 100644 --- a/.github/actions/style/action.yml +++ b/.github/actions/style/action.yml @@ -14,7 +14,7 @@ runs: shell: bash run: | echo "Checking for Markdown/MDX changes..." - if true || echo "$ALL_CHANGED_FILES" | grep -qE '\.mdx?$'; then + if 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 @@ -28,10 +28,10 @@ runs: shell: bash run: | echo "Checking for Rust code changes..." - if true || echo "$ALL_CHANGED_FILES" | grep -q '\.rs$'; then + if 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 @@ -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 true || echo "$ALL_CHANGED_FILES" | grep -q '^node-ui/'; then + if echo "$ALL_CHANGED_FILES" | grep -q '^node-ui/'; then echo "Running checks for the node-ui..." cd node-ui if ! pnpm prettier:check .; then @@ -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 true || echo "$ALL_CHANGED_FILES" | grep -q '^packages/calimero-sdk/'; then + if 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 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d001ff0f5..59ae770e9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,84 +14,39 @@ 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 diff --git a/packages/calimero-sdk/src/subscriptions/subscriptions.ts b/packages/calimero-sdk/src/subscriptions/subscriptions.ts index ec32d3742..97b172c7f 100644 --- a/packages/calimero-sdk/src/subscriptions/subscriptions.ts +++ b/packages/calimero-sdk/src/subscriptions/subscriptions.ts @@ -5,10 +5,7 @@ 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, @@ -19,23 +16,21 @@ 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, }