DIS-008: Forgejo Actions CI (build, test, lint) #28

Merged
dev merged 1 commit from phase-0/ci-pipeline into main 2026-04-09 10:55:54 +00:00
5 changed files with 1595 additions and 1 deletions
Showing only changes of commit c2a264f6d0 - Show all commits

21
.eslintrc.cjs Normal file
View file

@ -0,0 +1,21 @@
'use strict';
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
// Sicherheits-Guard: kein shell:true in child_process
'no-restricted-syntax': [
'error',
{
selector: 'Property[key.name="shell"][value.value=true]',
message: 'shell:true ist verboten — Command-Injection-Risiko. Nutze cross-spawn mit shell:false.'
}
],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
env: { node: true, es2022: true },
ignorePatterns: ['dist/', 'node_modules/'],
};

34
.forgejo/workflows/ci.yml Normal file
View file

@ -0,0 +1,34 @@
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint

View file

@ -57,3 +57,12 @@ mv ./workspaces/* ~/.disclaw/workspaces/
``` ```
Danach die DB-Eintraege in `data/disclaw.db` (Tabelle `workspaces`, Spalte `workspace_path`) aktualisieren. Danach die DB-Eintraege in `data/disclaw.db` (Tabelle `workspaces`, Spalte `workspace_path`) aktualisieren.
## CI
Jeder Pull Request gegen `main` durchläuft automatisch:
- `npm run build` — TypeScript-Kompilierung (Linux + Windows)
- `npm test` — Vitest Unit- und Integration-Tests (Linux + Windows)
- `npm run lint` — ESLint mit `shell:true`-Guard
Pipeline-Konfiguration: `.forgejo/workflows/ci.yml`

1526
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,8 @@
"build": "tsc", "build": "tsc",
"start": "node dist/index.js", "start": "node dist/index.js",
"dev": "tsc && node dist/index.js", "dev": "tsc && node dist/index.js",
"test": "vitest run" "test": "vitest run",
"lint": "eslint src --ext .ts"
}, },
"vitest": { "vitest": {
"include": ["tests/**/*.test.ts"], "include": ["tests/**/*.test.ts"],
@ -24,6 +25,9 @@
"@types/better-sqlite3": "^7.6.0", "@types/better-sqlite3": "^7.6.0",
"@types/cross-spawn": "^6.0.6", "@types/cross-spawn": "^6.0.6",
"@types/node": "^22.0.0", "@types/node": "^22.0.0",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^8.57.0",
"typescript": "^5.7.0", "typescript": "^5.7.0",
"vitest": "^4.1.4" "vitest": "^4.1.4"
}, },