commit 1659b5c7a43c35759ca2464a2bb546660b159c73 Author: artale Date: Sun May 17 01:17:25 2026 +0200 add CI template diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..bde3fe3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ +# Pi Package CI — shared GitLab CI template +# Use with: include https://warehouse:8888/artale/pi-ci-template/raw/main/.gitlab-ci.yml +# Or copy directly into each repo. + +image: node:22-alpine + +stages: + - validate + - test + +cache: + paths: + - node_modules/ + +before_script: + - node --version + - npm --version + +validate: + stage: validate + script: + - echo "Package: $(node -p "require('./package.json').name") v$(node -p "require('./package.json').version")" + - | + if [ -f tsconfig.json ]; then + npm ci --ignore-scripts 2>/dev/null || npm install --ignore-scripts + npx tsc --noEmit && echo "TypeScript: PASS" || { echo "TypeScript: FAIL"; exit 1; } + else + echo "No tsconfig — skipping compile" + fi + +test: + stage: test + script: + - | + if [ -f scripts/test.sh ]; then + bash scripts/test.sh && echo "Tests: PASS" || { echo "Tests: FAIL"; exit 1; } + elif [ -f test.sh ]; then + bash test.sh && echo "Tests: PASS" || { echo "Tests: FAIL"; exit 1; } + else + echo "No tests — skipping" + fi