⚡ perf(ci): single setup job with artifact sharing, caching, concurrency groups, fix badges
This commit is contained in:
+91
-60
@@ -36,93 +36,124 @@ jobs:
|
|||||||
echo "should_test=false" >> "$GITHUB_OUTPUT"
|
echo "should_test=false" >> "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
build-and-test:
|
setup:
|
||||||
name: Build & Test (Node ${{ matrix.node-version }})
|
name: Install & Build
|
||||||
needs: check-changes
|
needs: check-changes
|
||||||
if: needs.check-changes.outputs.should_test == 'true'
|
if: needs.check-changes.outputs.should_test == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [18.x, 20.x, 22.x]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js ${{ matrix.node-version }}
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: '20.x'
|
||||||
cache: 'npm'
|
|
||||||
|
- name: Cache node_modules
|
||||||
|
id: cache-nm
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: node-modules-${{ runner.os }}-node20-${{ hashFiles('package-lock.json') }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
if: steps.cache-nm.outputs.cache-hit != 'true'
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Type check
|
|
||||||
run: npm run type-check
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Unit & integration tests
|
- name: Upload workspace
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: workspace
|
||||||
|
path: |
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
test:
|
||||||
|
name: Unit & Integration Tests
|
||||||
|
needs: setup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20.x'
|
||||||
|
|
||||||
|
- name: Download workspace
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: workspace
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
|
lint:
|
||||||
|
name: Lint & Type Check
|
||||||
|
needs: setup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20.x'
|
||||||
|
|
||||||
|
- name: Download workspace
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: workspace
|
||||||
|
|
||||||
|
- name: Type check
|
||||||
|
run: npm run type-check
|
||||||
|
|
||||||
|
e2e:
|
||||||
|
name: E2E Tests
|
||||||
|
needs: setup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: '20.x'
|
||||||
|
|
||||||
|
- name: Download workspace
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: workspace
|
||||||
|
|
||||||
- name: Check build artifacts
|
- name: Check build artifacts
|
||||||
run: |
|
run: |
|
||||||
test -f dist/index.js
|
test -f dist/index.js
|
||||||
test -f dist/server.js
|
test -f dist/server.js
|
||||||
test -d dist/frontend
|
test -d dist/frontend
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Get Playwright version
|
||||||
if: matrix.node-version == '20.x'
|
id: pw-version
|
||||||
uses: actions/upload-artifact@v4
|
run: echo "version=$(node -e "console.log(require('./node_modules/@playwright/test/package.json').version)")" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Cache Playwright browsers
|
||||||
|
id: cache-pw
|
||||||
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
name: build-artifacts
|
path: ~/.cache/ms-playwright
|
||||||
path: dist/
|
key: playwright-${{ runner.os }}-${{ steps.pw-version.outputs.version }}
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
lint-check:
|
|
||||||
name: Lint Check
|
|
||||||
needs: check-changes
|
|
||||||
if: needs.check-changes.outputs.should_test == 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20.x'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Check for TypeScript errors
|
|
||||||
run: npm run type-check
|
|
||||||
|
|
||||||
e2e:
|
|
||||||
name: E2E Tests
|
|
||||||
needs: [check-changes, build-and-test]
|
|
||||||
if: needs.check-changes.outputs.should_test == 'true'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: '20.x'
|
|
||||||
cache: 'npm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Install Playwright browsers
|
- name: Install Playwright browsers
|
||||||
|
if: steps.cache-pw.outputs.cache-hit != 'true'
|
||||||
run: ./node_modules/.bin/playwright install --with-deps chromium
|
run: ./node_modules/.bin/playwright install --with-deps chromium
|
||||||
|
|
||||||
|
- name: Install Playwright system deps
|
||||||
|
if: steps.cache-pw.outputs.cache-hit == 'true'
|
||||||
|
run: ./node_modules/.bin/playwright install-deps chromium
|
||||||
|
|
||||||
- name: Run E2E tests
|
- name: Run E2E tests
|
||||||
run: npm run test:e2e
|
run: npm run test:e2e
|
||||||
env:
|
env:
|
||||||
@@ -140,7 +171,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: false
|
continue-on-error: false
|
||||||
name: CI Status Check
|
name: CI Status Check
|
||||||
needs: [check-changes, build-and-test, lint-check, e2e]
|
needs: [check-changes, setup, test, lint, e2e]
|
||||||
if: always()
|
if: always()
|
||||||
permissions:
|
permissions:
|
||||||
statuses: write
|
statuses: write
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ on:
|
|||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: docker-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
IMAGE_NAME_MCP: sanjibdevnath/mcp-excalidraw-local
|
IMAGE_NAME_MCP: sanjibdevnath/mcp-excalidraw-local
|
||||||
IMAGE_NAME_CANVAS: sanjibdevnath/mcp-excalidraw-local-canvas
|
IMAGE_NAME_CANVAS: sanjibdevnath/mcp-excalidraw-local-canvas
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ on:
|
|||||||
types: [completed]
|
types: [completed]
|
||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: release-main
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
id-token: write
|
id-token: write
|
||||||
@@ -185,9 +189,16 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '20.x'
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
cache: 'npm'
|
|
||||||
|
- name: Cache node_modules
|
||||||
|
id: cache-nm
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: node-modules-${{ runner.os }}-node20.x-${{ hashFiles('package-lock.json') }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
if: steps.cache-nm.outputs.cache-hit != 'true'
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# MCP Excalidraw Local
|
# MCP Excalidraw Local
|
||||||
|
|
||||||
[](https://github.com/sanjibdevnathlabs/mcp-excalidraw-local/actions/workflows/ci.yml)
|
[](https://github.com/sanjibdevnathlabs/mcp-excalidraw-local/actions/workflows/ci.yml)
|
||||||
[](https://github.com/sanjibdevnathlabs/mcp-excalidraw-local/actions/workflows/docker.yml)
|
[](https://github.com/sanjibdevnathlabs/mcp-excalidraw-local/actions/workflows/release.yml)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
|
|
||||||
A fully local, self-hosted Excalidraw MCP server with **SQLite persistence**, **multi-tenancy**, and **auto-sync** — designed to run entirely on your machine without depending on `excalidraw.com`.
|
A fully local, self-hosted Excalidraw MCP server with **SQLite persistence**, **multi-tenancy**, and **auto-sync** — designed to run entirely on your machine without depending on `excalidraw.com`.
|
||||||
|
|||||||
Reference in New Issue
Block a user