Appearance
CI/CD Pipeline - R-Type Project by Master KALAMBO DANIEL
Ce document dΓ©crit le pipeline CI/CD complet du projet R-Type utilisant GitHub Actions.
Vue d'ensemble
Le pipeline se compose de 3 jobs principaux :
- Build & Test : Compilation et tests unitaires
- Docker Build & Push : CrΓ©ation et publication des images Docker
- Notify : Notifications de statut
π Workflow
βββββββββββββββ
β Push/PR β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Build & Test (Ubuntu) β
β - Install dependencies β
β - Compile with CMake β
β - Run tests β
β - Upload artifacts β
ββββββββββββ¬βββββββββββββββ
β (success)
βΌ
βββββββββββββββββββββββββββ
β Docker Build & Push β
β - Download artifacts β
β - Build Server image β
β - Build Client image β
β - Push to GHCR β
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Notifications β
β - Summary report β
β - Status badges β
βββββββββββββββββββββββββββ
βββββββββββββββ
β Push/PR β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Build & Test (Ubuntu) β
β - Install dependencies β
β - Compile with CMake β
β - Run tests β
β - Upload artifacts β
ββββββββββββ¬βββββββββββββββ
β (success)
βΌ
βββββββββββββββββββββββββββ
β Docker Build & Push β
β - Download artifacts β
β - Build Server image β
β - Build Client image β
β - Push to GHCR β
ββββββββββββ¬βββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β Notifications β
β - Summary report β
β - Status badges β
βββββββββββββββββββββββββββ
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
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
DΓ©clenchement
Le pipeline se dΓ©clenche automatiquement sur :
- β
Push sur les branches :
main,dev,develop - β
Pull Request vers
main - β DΓ©clenchement manuel via l'interface GitHub Actions
Job 1 : Build & Test
Environnement
- OS : Ubuntu 22.04
- Compiler : g++ (C++17)
- Build System : CMake + Ninja
- Package Manager : Conan 2.0
Γtapes dΓ©taillΓ©es
Checkout du code
yaml- uses: actions/checkout@v4- uses: actions/checkout@v41Installation des dépendances système
- CMake, g++, Ninja
- Bibliothèques SFML (OpenGL, X11, etc.)
- Boost libraries
Configuration Conan
bashpip3 install conan==2.0.17 conan profile detect conan install .. --build=missingpip3 install conan==2.0.17 conan profile detect conan install .. --build=missing1
2
3Compilation CMake
bashcmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(nproc)cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(nproc)1
2VΓ©rification des binaires
r-type_serverr-type_clientrtype_game- Plugins
.sodansLibEngine/Systems/
Upload des artifacts
- Binaires compilΓ©s
- Assets
- Plugins
- RΓ©tention : 7 jours
Artifacts produits
rtype-binaries-{SHA}/
βββ r-type_server
βββ r-type_client
βββ rtype_game
βββ LibEngine/Systems/*.so
βββ Assets/**/*
rtype-binaries-{SHA}/
βββ r-type_server
βββ r-type_client
βββ rtype_game
βββ LibEngine/Systems/*.so
βββ Assets/**/*
1
2
3
4
5
6
2
3
4
5
6
Job 2 : Docker Build & Push
Condition : Succès du Job 1 + Push sur main ou dev
Images créées
Image Serveur
- Base : Ubuntu 22.04
- Taille : ~200 MB
- Port : 4242, 8080
- Registry :
ghcr.io/{owner}/{repo}/rtype-server - Tags :
latest(sur main){branch}(nom de la branche){branch}-{sha}(commit hash)
Image Client
- Base : Ubuntu 22.04 + SFML
- Taille : ~300 MB
- Display : X11 forwarding requis
- Registry :
ghcr.io/{owner}/{repo}/rtype-client - Tags : (identiques au serveur)
Processus de build
mermaid
graph LR
A[Download Artifacts] --> B[Prepare Files]
B --> C[Build Server Image]
B --> D[Build Client Image]
C --> E[Push to GHCR]
D --> E
graph LR
A[Download Artifacts] --> B[Prepare Files]
B --> C[Build Server Image]
B --> D[Build Client Image]
C --> E[Push to GHCR]
D --> E
1
2
3
4
5
6
2
3
4
5
6
Authentication
Le pipeline utilise automatiquement GITHUB_TOKEN pour :
- β Pull/Push vers GitHub Container Registry
- β
Permissions :
contents:read,packages:write
Job 3 : Notifications
Ce job s'exΓ©cute toujours (mΓͺme en cas d'Γ©chec) et :
- β Affiche le statut du build
- β Affiche le statut du dΓ©ploiement Docker
- β GΓ©nΓ¨re un rΓ©sumΓ© dans GitHub Actions
- β Γchoue si le build a Γ©chouΓ©
Utilisation
DΓ©veloppement local
bash
# Compiler localement
mkdir build && cd build
conan install .. --build=missing
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -j
# Tester
./r-type_server --help
./r-type_client --help
# Compiler localement
mkdir build && cd build
conan install .. --build=missing
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -j
# Tester
./r-type_server --help
./r-type_client --help
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
DΓ©clencher le pipeline
bash
# MΓ©thode 1 : Push sur une branche surveillΓ©e
git add .
git commit -m "feat: nouvelle fonctionnalitΓ©"
git push origin main
# MΓ©thode 2 : Via l'interface GitHub
# Actions > CI/CD Pipeline > Run workflow
# MΓ©thode 1 : Push sur une branche surveillΓ©e
git add .
git commit -m "feat: nouvelle fonctionnalitΓ©"
git push origin main
# MΓ©thode 2 : Via l'interface GitHub
# Actions > CI/CD Pipeline > Run workflow
1
2
3
4
5
6
7
2
3
4
5
6
7
Utiliser les images Docker
bash
# Pull depuis GitHub Container Registry
docker pull ghcr.io/epitechpge3-2025/g-cpp-500-cot-5-1-rtype-2/rtype-server:latest
# Lancer le serveur
docker run -d -p 4242:4242 \
ghcr.io/epitechpge3-2025/g-cpp-500-cot-5-1-rtype-2/rtype-server:latest
# Pull depuis GitHub Container Registry
docker pull ghcr.io/epitechpge3-2025/g-cpp-500-cot-5-1-rtype-2/rtype-server:latest
# Lancer le serveur
docker run -d -p 4242:4242 \
ghcr.io/epitechpge3-2025/g-cpp-500-cot-5-1-rtype-2/rtype-server:latest
1
2
3
4
5
6
2
3
4
5
6
Monitoring
Via GitHub Actions UI
- AccΓ©dez Γ Actions dans le repository
- SΓ©lectionnez le workflow "R-Type CI/CD Pipeline"
- Visualisez :
- Status de chaque job
- Temps d'exΓ©cution
- Artifacts disponibles
- Logs dΓ©taillΓ©s
Badges de statut
Ajoutez ces badges dans votre README :
markdown


1
Consulter les images Docker
bash
# Lister les tags disponibles
docker image ls | grep rtype
# Inspecter une image
docker inspect ghcr.io/epitechpge3-2025/g-cpp-500-cot-5-1-rtype-2/rtype-server:latest
# Lister les tags disponibles
docker image ls | grep rtype
# Inspecter une image
docker inspect ghcr.io/epitechpge3-2025/g-cpp-500-cot-5-1-rtype-2/rtype-server:latest
1
2
3
4
5
2
3
4
5
π§ Configuration
Variables d'environnement
DΓ©finies dans .github/workflows/build.yaml :
yaml
env:
BUILD_TYPE: Release
CONAN_VERSION: 2.0.17
env:
BUILD_TYPE: Release
CONAN_VERSION: 2.0.17
1
2
3
2
3
Secrets requis
GITHUB_TOKEN: Fourni automatiquement par GitHub Actions
Permissions
Le workflow nΓ©cessite :
yaml
permissions:
contents: read # Lire le code
packages: write # Publier les images Docker
permissions:
contents: read # Lire le code
packages: write # Publier les images Docker
1
2
3
2
3
π Fichiers du pipeline
.github/workflows/
βββ build.yaml # Pipeline principal
docker/
βββ Dockerfile.server # Image serveur
βββ Dockerfile.client # Image client
βββ docker-compose.yml # Orchestration
βββ README.md # Documentation Docker
.dockerignore # Exclusions Docker
.github/workflows/
βββ build.yaml # Pipeline principal
docker/
βββ Dockerfile.server # Image serveur
βββ Dockerfile.client # Image client
βββ docker-compose.yml # Orchestration
βββ README.md # Documentation Docker
.dockerignore # Exclusions Docker
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Avantages :
- Builds plus rapides (2-3x)
- RΓ©duction du temps de build
- RΓ©utilisation des layers Docker
Build parallèle
yaml
cmake --build build -j $(nproc)
cmake --build build -j $(nproc)
1
Utilise tous les cΕurs CPU disponibles.
Artifacts retention
yaml
retention-days: 7
retention-days: 7
1
Les artifacts sont conservΓ©s 7 jours pour Γ©conomiser l'espace.
π Liens utiles
π§ Support
En cas de problème :
- Consultez les logs GitHub Actions
- VΓ©rifiez la documentation Docker
- Ouvrez une issue sur GitHub