DIS-008: Forgejo Actions CI (build, test, lint) #28
5 changed files with 1595 additions and 1 deletions
21
.eslintrc.cjs
Normal file
21
.eslintrc.cjs
Normal 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
34
.forgejo/workflows/ci.yml
Normal 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
|
||||||
|
|
@ -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
1526
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue