-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (94 loc) · 2.86 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Lint Check
on:
pull_request:
branches: [ main, master ]
jobs:
lint:
name: Run Linters
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
# Caches gérés séparément pour chaque projet
- name: Cache SDK dependencies
uses: actions/cache@v3
with:
path: sdk/node_modules
key: sdk-${{ runner.os }}-node-${{ hashFiles('sdk/package-lock.json') }}
restore-keys: |
sdk-${{ runner.os }}-node-
- name: Cache Admin dependencies
uses: actions/cache@v3
with:
path: admin/node_modules
key: admin-${{ runner.os }}-node-${{ hashFiles('admin/package-lock.json') }}
restore-keys: |
admin-${{ runner.os }}-node-
- name: Cache Frontend dependencies
uses: actions/cache@v3
with:
path: frontend/node_modules
key: frontend-${{ runner.os }}-node-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
frontend-${{ runner.os }}-node-
# Installation des dépendances avec vérification d'erreurs
- name: Install SDK dependencies
run: |
cd sdk
if ! npm ci; then
echo "Failed to install SDK dependencies"
exit 1
fi
- name: Install Admin dependencies
run: |
cd admin
if ! npm ci; then
echo "Failed to install Admin dependencies"
exit 1
fi
- name: Install Frontend dependencies
run: |
cd frontend
if ! npm ci; then
echo "Failed to install Frontend dependencies"
exit 1
fi
# Vérifications avec gestion d'erreurs explicite
- name: Check SDK
run: |
cd sdk
echo "Running Prettier check on SDK..."
if ! npx prettier --check .; then
echo "SDK Prettier check failed"
exit 1
fi
- name: Check Admin
run: |
cd admin
echo "Running Prettier check on Admin..."
if ! npx prettier --check .; then
echo "Admin Prettier check failed"
exit 1
fi
echo "Running ESLint on Admin..."
if ! npm run lint; then
echo "Admin ESLint check failed"
exit 1
fi
- name: Check Frontend
run: |
cd frontend
echo "Running Prettier check on Frontend..."
if ! npx prettier --check .; then
echo "Frontend Prettier check failed"
exit 1
fi
echo "Running ESLint on Frontend..."
if ! npm run lint; then
echo "Frontend ESLint check failed"
exit 1
fi