mirror of
https://github.com/actions/checkout.git
synced 2026-05-13 16:09:50 +00:00
36 lines
803 B
YAML
36 lines
803 B
YAML
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
|