feat(workflow): Fixes #2 - Ajout github actions pour workflow #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Linting du projet | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout du code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| - name: Lint backend | |
| run: | | |
| if [ -d "backend" ]; then | |
| cd backend | |
| npm install eslint prettier --save-dev | |
| echo "🔹 Lancement de ESLint..." | |
| npx eslint . --ext .js,.ts | |
| echo "🔹 Vérification avec Prettier..." | |
| npx prettier --check . | |
| cd .. | |
| else | |
| echo "⚠️ Dossier backend introuvable" | |
| exit 1 | |
| fi | |
| - name: Lint frontend | |
| run: | | |
| if [ -d "frontend" ]; then | |
| cd frontend | |
| npm install eslint prettier --save-dev | |
| echo "🔹 Lancement de ESLint..." | |
| npx eslint . --ext .js,.jsx | |
| echo "🔹 Vérification avec Prettier..." | |
| npx prettier --check . | |
| cd .. | |
| else | |
| echo "⚠️ Dossier frontend introuvable" | |
| exit 1 | |
| fi |