diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50cc2d68..c6c641a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,18 +6,44 @@ on: pull_request: branches: [main, dev] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: + changes: + runs-on: ubuntu-latest + outputs: + backend: ${{ steps.filter.outputs.backend }} + frontend: ${{ steps.filter.outputs.frontend }} + contracts: ${{ steps.filter.outputs.contracts }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + backend: + - 'backend/**' + frontend: + - 'frontend/**' + contracts: + - 'contracts/**' + backend: + needs: changes + if: ${{ needs.changes.outputs.backend == 'true' }} name: Backend (Node.js ${{ matrix.node-version }}) runs-on: ubuntu-latest strategy: matrix: node-version: [20, 22] + defaults: + run: + working-directory: backend steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js ${{ matrix.node-version }} + - uses: actions/checkout@v4 + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} @@ -25,66 +51,76 @@ jobs: cache-dependency-path: backend/package-lock.json - name: Install dependencies - run: npm install - working-directory: backend - - - name: Run ESLint - run: npm run lint - working-directory: backend + run: npm ci - - name: Run tests - run: npm run test - working-directory: backend + - name: Lint & Test + run: | + npm run lint + npm run test - name: Build run: npm run build - working-directory: backend frontend: + needs: changes + if: ${{ needs.changes.outputs.frontend == 'true' }} name: Frontend (Node.js ${{ matrix.node-version }}) runs-on: ubuntu-latest strategy: matrix: node-version: [20, 22] + defaults: + run: + working-directory: frontend steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Setup Node.js ${{ matrix.node-version }} + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'npm' cache-dependency-path: frontend/package-lock.json - - name: Install dependencies - run: npm install - working-directory: frontend + - name: Cache Next.js build + uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/frontend/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('frontend/package-lock.json') }}-${{ hashFiles('frontend/src/**') }} + restore-keys: | + ${{ runner.os }}-nextjs-${{ hashFiles('frontend/package-lock.json') }}- - - name: Run ESLint - run: npm run lint - working-directory: frontend + - name: Install dependencies + run: npm ci - - name: Run tests - run: npm run test - working-directory: frontend + - name: Lint & Test + run: | + npm run lint + npm run test - name: Build run: npm run build - working-directory: frontend contracts: + needs: changes + if: ${{ needs.changes.outputs.contracts == 'true' }} name: Smart Contracts (Rust) runs-on: ubuntu-latest - container: rust:1.88 steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Build contracts - run: cargo build --release - working-directory: contracts + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown - - name: Check contracts - run: cargo check - working-directory: contracts \ No newline at end of file + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: "contracts -> target" + + - name: Build & Check + working-directory: contracts + run: | + cargo build --target wasm32-unknown-unknown --release + cargo check \ No newline at end of file diff --git a/backend/src/routes/stellar.ts b/backend/src/routes/stellar.ts index e5fe47bc..ad50a6ec 100644 --- a/backend/src/routes/stellar.ts +++ b/backend/src/routes/stellar.ts @@ -5,8 +5,6 @@ import { InvalidStellarInputError, } from '../services/stellar.js'; - - export const stellarRouter = Router(); // Get Stellar account info diff --git a/frontend/components/layout/Header.tsx b/frontend/components/layout/Header.tsx index f2706f9d..543bc1a5 100644 --- a/frontend/components/layout/Header.tsx +++ b/frontend/components/layout/Header.tsx @@ -32,15 +32,11 @@ import { import { getDashboardBreadcrumbs } from '@/lib/breadcrumbs'; import { ThemeSettingsModal } from '@/components/theme/ThemeSettingsModal'; -// 2. I built the isolated NetworkIndicator component right here const NetworkIndicator = () => { - // We use useAccount() in Wagmi v2 instead of useNetwork() const { chain, isConnected } = useAccount(); - // Hide it if the wallet isn't connected yet if (!isConnected) return null; - // In v2, if connected but 'chain' is undefined, it means they are on an unsupported network if (!chain) { return (
{name || 'User'}
-{email || 'No email'}
-{shortAddress}
-{name || 'User'}
+{email || 'No email'}
+