diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 000000000..4badee6bf --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,35 @@ +name: CI Pipeline + +# Déclenche la pipeline à chaque PR et push sur main +on: + pull_request: + branches: [ main ] + push: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # 1️⃣ Checkout du repo + - name: Checkout repository + uses: actions/checkout@v4 + + # 2️⃣ Installer Node.js selon .nvmrc + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + + # 3️⃣ Installer les dépendances de manière reproductible + - name: Install dependencies + run: npm ci + + # 4️⃣ Lancer les tests unitaires + - name: Run unit tests + run: npm test + + # 5️⃣ Linter le code + - name: Lint code + run: npm run lint diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..a45fd52cc --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24