-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.7 KB
/
Copy pathtests.yml
File metadata and controls
71 lines (59 loc) · 1.7 KB
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
name: 'Tests Backend et Frontend'
on:
pull_request:
types: [opened, edited, synchronize]
push:
branches:
- main
- dev
jobs:
test-backend:
name: 'Tests Backend'
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:7
ports:
- 27017:27017
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
- name: 'Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: saintBarthVolleyApp/backend/package-lock.json
- name: 'Installer les dépendances'
run: npm ci
working-directory: saintBarthVolleyApp/backend
- name: 'Lancer les tests backend'
run: npm test
working-directory: saintBarthVolleyApp/backend
env:
NODE_ENV: test
MONGO_URI: mongodb://localhost:27017/sbv_test
JWT_SECRET: test_secret_ci
PORT: 5000
test-frontend:
name: 'Build Frontend (vérification)'
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
- name: 'Setup Node.js'
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: saintBarthVolleyApp/frontend/package-lock.json
- name: 'Installer les dépendances'
run: npm ci
working-directory: saintBarthVolleyApp/frontend
- name: 'Build Next.js'
run: npm run build
working-directory: saintBarthVolleyApp/frontend
env:
# Pas de basePath en CI, pas besoin de l'URL de prod
NEXT_BASE_PATH: ''
NEXT_PUBLIC_API_URL: ''