SPB Git

Repository Public

ci.sh 3.0 KB 56 lines shellscript

1#!/bin/zsh2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : MacLustr Social Engine & Remote Navigator8# File             : scripts/ci.sh9# Module           : scripts10# Repository       : https://git.spboucher.ai/maclustr-social11# Project Website  : https://social.spboucher.ai12# Created          : 2026-12-0113# Last Modified    : 2026-12-0114#15# Author           : Simon-Pierre Boucher16# Position         : Professor of Finance17# Institution      : Université du Québec en Outaouais (UQO)18# Organization     : SP Boucher19# Website          : https://spboucher.ai20# Git              : https://git.spboucher.ai21#22# Preferred Contact: admin@spboucher.ai23# Technical Contact: dev@spboucher.ai24# Security/Admin   : admin@spboucher.ai25#26# Copyright (c) 202627# Simon-Pierre Boucher28# All rights reserved where applicable. This file is governed by the29# applicable project license, copyright notices and relevant law.30# Existing third-party rights and notices remain unaffected.31#32# License          : None specified (no license file in this repository)33#34# Do not embed credentials, private keys, access tokens,35# certificates or confidential personal information.36#37# =============================================================================38# END OF SP BOUCHER SOURCE HEADER39# =============================================================================4041# Local CI (the internal forge runs no pipelines): lint, secret scan, typecheck, tests, dependency audit, reproducible build.42set -euo pipefail43cd "${0:A:h}/.."44export PATH="/opt/homebrew/bin:/opt/homebrew/opt/postgresql@17/bin:$PATH"45step() { print -P "%B── $1%b"; }46step "installation (lockfile figé)"; pnpm install --frozen-lockfile --silent47step "lint + secrets"; node scripts/lint.mjs48step "typage"; npx tsc --noEmit -p tsconfig.json49step "tests unitaires, intégration, sécurité"; npx vitest run tests/unit tests/integration tests/security50step "tests du client web"; npx vitest run --root apps/social-web51if [[ "${MLS_CI_E2E:-1}" == "1" ]]; then step "tests bout en bout (Chromium)"; npx vitest run tests/e2e; fi52step "audit des dépendances"; pnpm audit --prod --audit-level high || { echo "vulnérabilité élevée dans une dépendance"; exit 1; }53step "build reproductible"; pnpm build >/dev/null; A=$(cat dist/*.mjs | shasum -a 256); pnpm build:services >/dev/null; B=$(cat dist/*.mjs | shasum -a 256); [[ "$A" == "$B" ]] || { echo "build non reproductible"; exit 1; }54step "OpenAPI à jour"; MLS_CONFIG_DIR=$(mktemp -d) MLS_DATA_DIR=$(mktemp -d) DATABASE_URL="${MLS_CI_DATABASE_URL:-postgres://127.0.0.1/mls_dev}" node dist/openapi.mjs 2>/dev/null | diff -q - docs/openapi.json >/dev/null || { echo "docs/openapi.json n’est pas à jour (node dist/openapi.mjs > docs/openapi.json)"; exit 1; }55echo "CI ok"56
Files main
Menu

Theme