-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (59 loc) · 2.32 KB
/
Copy pathci-freebsd.yml
File metadata and controls
70 lines (59 loc) · 2.32 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
name: CI FreeBSD
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test-freebsd:
name: Tests sur FreeBSD 14
runs-on: ubuntu-latest
steps:
- name: Récupérer le code
uses: actions/checkout@v4
- name: Tests sur FreeBSD 14
uses: cross-platform-actions/action@v0.25.0
with:
operating_system: freebsd
version: "14.1"
run: |
# Installer les dépendances
sudo env IGNORE_OSVERSION=yes pkg update -q
sudo env IGNORE_OSVERSION=yes pkg install -y python3 tree curl
# Bootstrap pip puis Flask
python3 -m ensurepip --upgrade 2>/dev/null || true
python3 -m pip install --quiet flask
# Supprimer les retours chariot Windows (\r)
sed -i '' 's/\r$//' lsit.py \
Moteur/base/moteur_base.py \
Moteur/linux/moteur_linux.py \
Moteur/freebsd/moteur_freebsd.py
# Vérifier les imports (architecture Moteur/)
python3 -c "from Moteur.base.moteur_base import choisir_moteur"
python3 -c "from Moteur.freebsd.moteur_freebsd import MoteurFreeBSD"
# Vérifier la version
python3 lsit.py --version
# Générer un rapport TXT
python3 lsit.py --format txt
test -f rapport_lsit.txt
test -s rapport_lsit.txt
# Générer un rapport JSON et valider les champs
python3 lsit.py --format json
test -f rapport_lsit.json
python3 -c "
import json
with open('rapport_lsit.json') as f:
data = json.load(f)
champs = ['date','machine','ram','cpu','processus','arborescence',
'securite_ports','securite_sudoers','stockage','uptime','load_average']
for champ in champs:
assert champ in data, f'Champ manquant : {champ}'
print('JSON valide — tous les champs présents.')
"
# Vérifier que le serveur Flask démarre
python3 lsit.py --serve &
SERVER_PID=$!
sleep 3
curl --fail --silent http://localhost:5000 > /dev/null
curl --fail --silent http://localhost:5000/api/donnees > /dev/null
kill $SERVER_PID