Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
584d5fc
feat: premier commit — activation de la CI
thomase-spl Jun 4, 2026
6641ed3
fix: no change, ci test
thomase-spl Jun 4, 2026
9ac0658
feat: add GitHub Actions workflow for hello pipeline
thomase-spl Jun 4, 2026
8457f16
feat: add date support to hello workflow
thomase-spl Jun 4, 2026
1188b57
feat: add GitHub Actions CI workflow for NexaCloud API tests
thomase-spl Jun 4, 2026
bb88c08
feat: add flake8 linting job to CI workflow
thomase-spl Jun 4, 2026
f892fdc
fix: add unnecessary spaces to test ci
thomase-spl Jun 4, 2026
017c5e0
fix: remove unnecessary whitespace in app.py
thomase-spl Jun 4, 2026
30206d9
fix: update expected log info count in test_logs_summary_values
thomase-spl Jun 4, 2026
2ba42e0
fix: update expected log info count in test_logs_summary_values
thomase-spl Jun 4, 2026
9c4b2db
feat: enhance CI workflow by adding pip caching and coverage reportin…
thomase-spl Jun 4, 2026
fc80206
feat: add demo secrets workflow for API key usage
thomase-spl Jun 4, 2026
f439761
feat: add deployment workflow for staging and production environments
thomase-spl Jun 4, 2026
ae5c02a
feat: add input options for workflow dispatch in deployment
thomase-spl Jun 4, 2026
ecca84f
feat: update deployment workflow input options for clarity and defaults
thomase-spl Jun 4, 2026
f779aef
feat: refactor deployment jobs to use dynamic environment input
thomase-spl Jun 4, 2026
7c3ee70
feat: enhance deployment script with environment-specific messages an…
thomase-spl Jun 4, 2026
3923d1d
feat: update deployment workflow input to standardize environment sel…
thomase-spl Jun 4, 2026
764e4da
feat: add CI/CD workflow for NexaCloud API with quality checks, stagi…
thomase-spl Jun 5, 2026
2eb00b8
fix: no change, cicd test
thomase-spl Jun 5, 2026
f2031c3
feat: update Azure App Service deployment configurations for staging …
thomase-spl Jun 5, 2026
0ee91e4
feat: add smoke tests for post-deployment verification in staging and…
thomase-spl Jun 5, 2026
a1206c6
fix: correct duplicate URL in smoke test for production deployment
thomase-spl Jun 5, 2026
b7ee043
fix: add extra space to trigger pre-commit
thomase-spl Jun 5, 2026
9b713b5
fix: add extra space to trigger pre-commit
thomase-spl Jun 5, 2026
61bdd8e
add extra space to trigger pre-commit
thomase-spl Jun 5, 2026
2574722
fix: add extra space to trigger pre-commit
thomase-spl Jun 5, 2026
c2a381c
feat: add dependabot configuration for GitHub Actions and Python depe…
thomase-spl Jun 5, 2026
5ad3f0c
build(deps): bump actions/upload-artifact from 4 to 7
dependabot[bot] Jun 5, 2026
ffd9517
Merge pull request #2 from thomase-spl/dependabot/github_actions/acti…
thomase-spl Jun 5, 2026
e99f9e7
feat: add CODEOWNERS file to define review responsibilities
thomase-spl Jun 5, 2026
bbf17a9
feat: add CODEOWNERS file to define review responsibilities
thomase-spl Jun 5, 2026
3c58c96
fix: no change, ci test
thomase-spl Jun 11, 2026
8ee0ba8
fix: no change, some test
thomase-spl Jun 11, 2026
df89c33
Merge branch 'main' into feat/ma-modification
thomase-spl Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Syntaxe : <pattern de fichier> <@utilisateur ou @org/équipe>

# Par défaut : tout changement requiert une review de ces personnes
* @thomase-spl

# Les workflows CI/CD ne peuvent être modifiés que par le lead DevOps
.github/workflows/ @thomase-spl

# Le fichier de dépendances requiert une validation technique
ressources/requirements.txt @thomase-spl

# Les fichiers de sécurité requièrent une double validation
.github/dependabot.yml @thomase-spl
.github/CODEOWNERS @thomase-spl
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2

updates:
# ── Mettre à jour les actions GitHub ──────────────────────────────
- package-ecosystem: "github-actions"
directory: "/" # cherche dans .github/workflows/
schedule:
interval: "weekly" # vérifie chaque semaine
labels:
- "dependencies"
- "github-actions"

# ── Mettre à jour les dépendances Python ──────────────────────────
- package-ecosystem: "pip"
directory: "/ressources" # cherche requirements.txt ici
schedule:
interval: "weekly"
labels:
- "dependencies"
- "python"
open-pull-requests-limit: 5 # max 5 PRs ouvertes en même temps
58 changes: 51 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,62 @@
name: CI
name: CI — NexaCloud API

on:
push:
branches: [ "main" ]
branches: [main]
pull_request:
branches: [ "main" ]
branches: [main]

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
- name: Checkout
uses: actions/checkout@v4

- name: Example step
run: echo "Add your build/test steps here!"
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('ressources/requirements.txt') }}

- name: Installer les dépendances
run: pip install -r ressources/requirements.txt

- name: Lancer les tests
run: pytest ressources/ -v

- name: Tests avec couverture
run: pytest ressources/ -v --cov=ressources --cov-report=term-missing

- name: Générer le rapport HTML
run: pytest ressources/ --cov=ressources --cov-report=html

- name: Upload du rapport
uses: actions/upload-artifact@v7
with:
name: rapport-couverture
path: htmlcov/

lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Installer flake8
run: pip install flake8

- name: Lint avec flake8
run: flake8 ressources/ --config ressources/.flake8
88 changes: 88 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI/CD — NexaCloud API

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
# ── Job 1 : Qualité ────────────────────────────────────────────────
qualite:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- run: pip install -r ressources/requirements.txt

- name: Lint
run: flake8 ressources/ --config ressources/.flake8

- name: Tests
run: pytest ressources/ -v --cov=ressources

# ── Job 2 : Staging ───────────────────────────────────────────────
staging:
runs-on: ubuntu-latest
needs: qualite # attend que le job qualite réussisse
environment: staging
if: github.ref_name == 'main' # uniquement sur la branche main

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Installer les dépendances
run: pip install -r ressources/requirements.txt

- name: Déployer sur Azure App Service (staging)
uses: azure/webapps-deploy@v3
with:
app-name: "ten-nexacloud-api-staging-27050"
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_STAGING }}
package: ressources/

# Smoke test post-déploiement : vérifier que l'app répond avant de valider
- name: Smoke test post-déploiement
run: |
sleep 30 # attendre que l'app démarre
curl --fail https://ten-nexacloud-api-staging-27050.azurewebsites.net/health || exit 1
# Si ce test échoue, le job échoue → on peut déclencher un rollback

# ── Job 3 : Production ────────────────────────────────────────────
production:
runs-on: ubuntu-latest
needs: staging
environment: production
if: github.ref_name == 'main'

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Installer les dépendances
run: pip install -r ressources/requirements.txt

- name: Déployer sur Azure App Service (production)
uses: azure/webapps-deploy@v3
with:
app-name: "ten-nexacloud-api-production-29408"
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE_PRODUCTION }}
package: ressources/

# Smoke test post-déploiement : vérifier que l'app répond avant de valider
- name: Smoke test post-déploiement
run: |
sleep 30 # attendre que l'app démarre
curl --fail https://ten-nexacloud-api-production-29408.azurewebsites.net/health || exit 1
44 changes: 25 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
name: Run Azure Login with OIDC
name: Deploy

on:
workflow_dispatch:

permissions:
id-token: write
contents: read
workflow_dispatch:
inputs:
environment:
description: "Choix de l'environnement de déploiement"
required: true
default: "staging"
type: choice
options:
- staging
- production

jobs:
build-and-deploy:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}

steps:
- name: Azure login
uses: azure/login@v3
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Checkout
uses: actions/checkout@v4

- name: Azure CLI script
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
az account show
- name: Déployer en ${{ inputs.environment }}
run: |
if [ "${{ inputs.environment }}" = "production" ]; then
echo "🚀 Déploiement en PRODUCTION"
echo "URL : https://nexacloud.example.com"
else
echo "✅ Déploiement en STAGING"
echo "URL : https://staging.nexacloud.example.com"
fi
27 changes: 27 additions & 0 deletions .github/workflows/hello.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Hello NexaCloud

on:
push:
branches: [main]
workflow_dispatch: # permet de déclencher manuellement depuis l'interface GitHub

jobs:
salutation:
runs-on: ubuntu-latest

steps:
- name: Checkout du code
uses: actions/checkout@v4

- name: Informations sur l'environnement
run: |
echo "Repo : ${{ github.repository }}"
echo "Branche : ${{ github.ref_name }}"
echo "Commit : ${{ github.sha }}"
echo "Acteur : ${{ github.actor }}"

- name: Lister les fichiers du repo
run: ls -la

- name: Afficher la date et l'heure
run: date
15 changes: 15 additions & 0 deletions .github/workflows/secrets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Demo Secrets

on:
workflow_dispatch:

jobs:
demo:
runs-on: ubuntu-latest

steps:
- name: Utiliser le secret
run: |
echo "La clé existe : ${{ secrets.API_KEY != '' }}"
# ⚠️ Cette ligne sera masquée dans les logs :
echo "Valeur : ${{ secrets.API_KEY }}"
1 change: 1 addition & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Mon TP GitHub Actions
2 changes: 2 additions & 0 deletions ressources/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,5 @@ def test_logs_critical_alerte(client):
assert "critical_count" in data
assert "alerte" in data
assert data["alerte"] is True

# no change, some test
Loading