Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
24f4fe5
refactor: remove unused exports and island code
ttbombadil Mar 12, 2026
a287b7b
refactor: strip remaining unused exports after deep cleanup
ttbombadil Mar 12, 2026
47ff626
fix: resolve macOS arm64 build locks and update node types
ttbombadil Mar 12, 2026
0137c5c
refactor: update debug message in Arduino loop for clarity
ttbombadil Mar 12, 2026
a3d024f
feat: add sandbox image build step to CI
ttbombadil Mar 12, 2026
2f0b904
feat: add sandbox build script to package.json
ttbombadil Mar 12, 2026
3b8483d
refactor: adjust Playwright configuration for parallelism and update …
ttbombadil Mar 12, 2026
467a57b
feat: update sandbox configuration to use unowebsim image and enable …
ttbombadil Mar 12, 2026
de8cad8
refactor: enable parallel execution for Playwright tests and increase…
ttbombadil Mar 12, 2026
7c74328
feat: enhance LocalCompiler and ProcessController for improved proces…
ttbombadil Mar 13, 2026
f2ac3b0
feat: enhance CI workflow and Docker setup for improved caching and b…
ttbombadil Mar 13, 2026
fd925f6
feat: add Arduino compiler cache and storage binaries to .gitignore
ttbombadil Mar 13, 2026
17f2ef4
refactor: streamline CI workflow
ttbombadil Mar 13, 2026
53fcaaa
feat: enhance CI workflow with Arduino toolchain caching
ttbombadil Mar 13, 2026
b7ab4e0
chore: update vitest and related dependencies to version 4.1.0
ttbombadil Mar 13, 2026
c30314b
refactor: update load test suite to use async server start/stop funct…
ttbombadil Mar 13, 2026
b9fcf9b
fix: stabilize vitest 4.x and docker integration tests
ttbombadil Mar 13, 2026
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
86 changes: 65 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ name: CI (Quality Gate & Coverage)

on:
push:
branches:
- '**' # Triggert bei JEDEM Push auf JEDEN Branch
branches: [ '**' ]
pull_request:
branches:
- '**' # Triggert bei JEDEM Pull Request
branches: [ '**' ]

permissions:
contents: write
pages: write
id-token: write

jobs:
# JOB 1: Schnellläufer (Unit Tests, Linting, TypeCheck)
build-and-test:
name: Lint, TypeCheck & Unit Tests
name: Lint & Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -29,58 +28,103 @@ jobs:
- name: Install dependencies
run: npm ci

# Neu: Auch Unit-Tests brauchen die Toolchain zum Kompilieren
- name: Cache Arduino Toolchain (Unit)
uses: actions/cache@v4
with:
path: |
/usr/local/bin/arduino-cli
~/.arduino15
key: ${{ runner.os }}-arduino-unit-${{ hashFiles('package-lock.json') }}

- name: Install Arduino CLI & Core
run: |
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
arduino-cli core update-index
arduino-cli core install arduino:avr
if ! command -v arduino-cli &> /dev/null; then
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
fi
arduino-cli core list | grep "arduino:avr" || (arduino-cli core update-index && arduino-cli core install arduino:avr)

- name: Static Analysis (Lint & TypeCheck)
- name: Static Analysis & Unit Tests
env:
# Separater Pfad für Unit-Tests, um Seiteneffekte zu vermeiden
ARDUINO_CACHE_DIR: /tmp/arduino-unit-cache
run: |
npm run check
npm run lint

- name: Run Tests with Coverage
# Ersetzt den normalen Test-Lauf, da Coverage alles abdeckt
run: npm run test:coverage
npm run test:coverage

- name: Deploy Coverage to GitHub Pages
# Nur bei Push auf Haupt-Branches ausführen
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./coverage/lcov-report
publish_branch: gh-pages

# JOB 2: Schwergewicht (Docker & E2E)
e2e-tests:
name: Playwright E2E
needs: build-and-test # WICHTIG: Startet erst, wenn Unit-Tests grün sind
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache E2E Assets (Arduino, Playwright, Sketches)
uses: actions/cache@v4
with:
path: |
/usr/local/bin/arduino-cli
~/.arduino15
~/.cache/ms-playwright
server/arduino-cache
storage/binaries
key: ${{ runner.os }}-e2e-turbo-${{ hashFiles('package-lock.json', 'server/services/arduino-compiler.ts') }}
restore-keys: |
${{ runner.os }}-e2e-turbo-

- name: Install Arduino CLI & Core
run: |
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
arduino-cli core update-index
arduino-cli core install arduino:avr
if ! command -v arduino-cli &> /dev/null; then
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
fi
arduino-cli core list | grep "arduino:avr" || (arduino-cli core update-index && arduino-cli core install arduino:avr)

- name: Install Playwright Browsers
run: npx playwright install --with-deps chromium

- name: Build Sandbox Image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: unowebsim-sandbox:latest
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run E2E Tests
run: npx playwright test --update-snapshots=missing
env:
ARDUINO_CACHE_DIR: ${{ github.workspace }}/server/arduino-cache
run: npx playwright test --update-snapshots=missing --workers=2

- name: Commit new Linux visual baselines
if: always()
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add 'e2e/visual-full-context.spec.ts-snapshots/*-linux.png'
git diff --staged --quiet || (git commit -m "chore(e2e): update linux visual baselines [skip ci]" && git push)

- name: Upload E2E Report & Artifacts
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -89,4 +133,4 @@ jobs:
path: |
playwright-report/
test-results/
retention-days: 7
retention-days: 7
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ yarn-error.log*
/coverage/
*.tsbuildinfo

# Arduino Compiler Cache (Binaries & Build-Artifacts)
server/arduino-cache/
storage/binaries/

# Project specific temp folders (runtime artifacts)
/temp/*
!/temp/.gitkeep
Expand Down
3 changes: 2 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
npm run test
# Führt nur Tests aus, die Dateien betreffen, die sich seit dem letzten Push geändert haben
npm run test:fast
46 changes: 23 additions & 23 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"files.exclude": {
"vite.config.ts": true,
"vercel.json": true,
"test-vercel-build.sh": true,
"tsconfig.json": true,
"tailwind.config.ts": true,
"screenshot.png": true,
"README copy.md": true,
"postcss.config.js": true,
"package-lock.json": true,
"LICENSE": true,
"drizzle.config.ts": true,
"components.json": true,
"build.sh": true,
".vercelignore": true,
".gitlab-ci.yml": true,
"node_modules": true,
"temp": true,
"vitest.config.ts": true,
"playwright.config.ts": true,
"package.json": true,
"licenses.json": true,
"docker-compose.yml": true,
"commitlint.config.cjs": true
"vite.config.ts": false,
"vercel.json": false,
"test-vercel-build.sh": false,
"tsconfig.json": false,
"tailwind.config.ts": false,
"screenshot.png": false,
"README copy.md": false,
"postcss.config.js": false,
"package-lock.json": false,
"LICENSE": false,
"drizzle.config.ts": false,
"components.json": false,
"build.sh": false,
".vercelignore": false,
".gitlab-ci.yml": false,
"node_modules": false,
"temp": false,
"vitest.config.ts": false,
"playwright.config.ts": false,
"package.json": false,
"licenses.json": false,
"docker-compose.yml": false,
"commitlint.config.cjs": false
},
"chat.tools.terminal.autoApprove": {
"npm ls": true,
Expand Down
30 changes: 16 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Multi-stage build using Node 25.2.1
FROM node:25.2.1 AS builder
WORKDIR /app

# Install dependencies (including devDeps for build)
COPY package.json package-lock.json* ./
RUN npm install

# Copy sources and build (client + server)
COPY . .
RUN npm run build

Expand All @@ -15,24 +11,30 @@ RUN npm run build
FROM node:25.2.1-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
# WICHTIG: Setze die Variable auch im Container, damit der Pfad konsistent bleibt
ENV ARDUINO_CACHE_DIR=/app/server/arduino-cache

# Install Arduino CLI and required tools
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates tar xz-utils g++ \
&& curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh \
&& arduino-cli config init \
&& arduino-cli core update-index \
&& arduino-cli core install arduino:avr \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
&& apt-get install -y --no-install-recommends curl ca-certificates tar xz-utils g++ \
&& curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh \
&& arduino-cli config init \
&& arduino-cli core update-index \
&& arduino-cli core install arduino:avr \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Erstelle die notwendigen Verzeichnisse für den Compiler-Cache und Storage
# Damit der Node-User (falls du einen nutzt) Schreibrechte hat
RUN mkdir -p /app/server/arduino-cache /app/storage/binaries /app/temp

# Copy built artifacts
COPY --from=builder /app/dist ./dist

# Copy package metadata and install all dependencies
# (vite is marked as external in esbuild but needed at runtime for middleware mode)
# Copy package metadata and install dependencies
COPY package.json package-lock.json* ./
# Da Vite zur Laufzeit gebraucht wird, bleiben wir bei --production=false
RUN npm install --legacy-peer-deps --production=false

EXPOSE 3000
CMD ["npm", "run", "start"]
CMD ["npm", "run", "start"]
Loading
Loading