From 333e4d36e575b82d89e91db2d66540bb07d54002 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 12:03:19 +0200 Subject: [PATCH 01/24] =?UTF-8?q?feat:=20premier=20commit=20=E2=80=94=20ac?= =?UTF-8?q?tivation=20de=20la=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notes.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 notes.md diff --git a/notes.md b/notes.md new file mode 100644 index 0000000..2c821cd --- /dev/null +++ b/notes.md @@ -0,0 +1 @@ +# Mon TP GitHub Actions From 263e1a90259e19ed0ded442a4b77f90c120546f0 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 13:47:19 +0200 Subject: [PATCH 02/24] Hello-NexaCloud --- .github/workflows/hello.yml | 24 ++++++++++++++++++ ressources/__pycache__/app.cpython-314.pyc | Bin 0 -> 1679 bytes .../test_app.cpython-314-pytest-8.2.0.pyc | Bin 0 -> 10558 bytes 3 files changed, 24 insertions(+) create mode 100644 .github/workflows/hello.yml create mode 100644 ressources/__pycache__/app.cpython-314.pyc create mode 100644 ressources/__pycache__/test_app.cpython-314-pytest-8.2.0.pyc diff --git a/.github/workflows/hello.yml b/.github/workflows/hello.yml new file mode 100644 index 0000000..f35681c --- /dev/null +++ b/.github/workflows/hello.yml @@ -0,0 +1,24 @@ +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 diff --git a/ressources/__pycache__/app.cpython-314.pyc b/ressources/__pycache__/app.cpython-314.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d5b0916cfa751b7076ef1cf6dcbec852e7706309 GIT binary patch literal 1679 zcmZ`(%}*Og6rb4-+jwn5pa~_AvIL~ov|$@HQc|@FMG!Djp>+6AA_1$#USPv|cQvz1 zflD2wQk+Z0AqS2*hFkxHO1<>ZgC(~W9p#d?e}EB(UOO{u6BCIi&C|^O-h1C>7*T9t3OB5Li?0Fq})MB5D0c zB(D!3Wj%w`b=gqD#G1O$8RP95C0br6*$eJ8p)hrcb?V%@qs_YG66^H2wbo{xzQj6n zZk=tj*47l1yY~=)(lr1E0Q2o@=O6D;C+b31?n?1#5TNd1vGP5U%f6+pAQ%hw^}j1G z^ofO8ecs-)CS5-&rRN;a5uc`Ai|pu8=(rB~<=EDXe!0xFv*Fr$DbfQcuwBQq^~qUd za!M~*9?==Hw4l#8VIkVkCyJrtdt@w~m#8X&(d1*|d(P%QRUB{Ar^)Xu>^a^RRc(xY zOjAYdgig_NDKv`hDe-=@831P^OjW>Yv#Wr09zi4_87W9L_USRi{FY;I#x$Ul#xnCG#wNDB;?9PJ@xC!- zlbz5Hj0bx@xwYt&1K0PAFu1klgxk@Efo($k2p4T)#093R)l$_V?J5K^|y#YqH@{7`xjVo zMuL?t{NJ)#ZB8BlZOq_&UJ@my+SlLAn2XDEa}(&%yWBGTHnVvf=Im~;MY7@sR=F2n z)V0ByG8mJ~#pGI}bAergxd?Vs!grPFSP=MxH=-#4SYiKPnldiZrzz7cTaIU% zOU`pPVEopSy%B9uCGc@LpU={yX_ow=X;O8Qzi7;v#7$tno>jIPB(rH1)TxU7D73}A zis2CT7Zj8pPB^n+6g!ew|S1F5Saw#>DOeqM)H zIXueIYaAVY3y#-eKL>RV4scLE2Wwh?9S(3>Ux~;!8e-eX03}mB_+9QhQIgMQp3EGM S94%F5{#0(B%0Rg;>ij>`S!dAz literal 0 HcmV?d00001 diff --git a/ressources/__pycache__/test_app.cpython-314-pytest-8.2.0.pyc b/ressources/__pycache__/test_app.cpython-314-pytest-8.2.0.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c8f3ece7de3c42bf5ef64aa7490e887ee72902b9 GIT binary patch literal 10558 zcmeHN-EZ606(=c5q`v);&&F}+xJ{zOmK|wy((s;mtJnfuIQKV$0vAQ_kgDP{ud+5r@1YsK${k~7 z!gl1CTO-&4)NohD8POJxF+UY%`@F&YyBs>mxy3ba?O%Vg-GTK4j`2k-I6M*WNM~b(R5Xsx|)sM$goZbhTgLM5KO%JLm;?)T!ou- z*8As|&GKHEe;;aY6t=LxN z**XAZmHDRcz=Np=*S?OYKEM2{%j@xhulNB1XU~+HyMjy9~owV!I9lGi_^EIAx7>k@Dr@u zH#a=N^6e00j$2+h$6%w#M8LQ)uqPTVeTNTffwI_xlMe zhh#pmqt5L)k6&{5rENoA+gxZQz#lU#M`WQ8&ao|}k@;S4g@KVfyne9Th&Qr#zst(v zMb_jlvSbR*albc`fA?NkQz!^>bmR@c#uVk)(oBJ;C;U5)e+w&Z{0r>B>q}2K3Mbq@ z_aJb>@xb~!b5ZoxEhk>umiOA`xE6lJ~j$H&Gb<-S@%VQtxpU9~0SUe;lAPRLvt zb3_n&rlDIZX2+3CK2IqYh)!F2>y){2K4W3w`5R7z_O=|(xQ8WYk>p$2o^#uta|Gyq zUn{A#WK)Mopi$P?=iH@BYiw--M;^~uv7a^mNSEkjV;L*!&QdHHWi|Gxbjhul%vjK^ z4_lwjSYBx!O5;vwLA9NDpqmqW&s9=Ig*d&%l2WM@iE5IPu?PxGbrMiryj|5QpgSxl zQZb-~HVMAKCAt9_}4#Qo!Q_| z)L-?r&Y$>eyuThF_;Y+;>9&9FVL-ZZa&!m0&8Gk2t#F&( zX0so7n^BpUV>__6rnK&IZOwkLwpg356_w+1qVUS4x5>>dxA<7xJb3MHDsb~CUunuW zaEYY}Z%@XSJHJm;g9cjo@zLvBh(L_$XJ=!r%p_>z(ceF zKcwFAgcH(q+qX9|yu)ky9m5emQHYK>WLTwMp;#iCt$|m$#yXs)XBwU>c(;1RoQEQkh%?vOO~g*+MP=2|9%n)aL1I z?i`_xA)Y|7aRT5Ul4{AW5|vEBKob0{Yw+ay=1*=teR{{tpH?67>%O-iMK;8v^_{t% zh(|ZXk^1Yp{vwWShME40TWvG}xJ+%dZ}@H7XwberH4#Uyz{y;ToDbdl&C*oEhxy2p zK-)wdtGEaMr*58;)Ws7SO8mr+6niS3N3F~396MP=V2uB4w4SIzzuQoG6A<{6*x(pIh4jF;wj51Htv=bo3nyO_Tt=?yh{m?ZwKQR)}YLZ4L-YC%Sk(6Q0fP-M7TS57%lfQ S0z3L_pTG|N8_01w(SHH5%K{+) literal 0 HcmV?d00001 From e1888c3da88ccf8df52756d7db1346210f515369 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:12:15 +0200 Subject: [PATCH 03/24] feat:modif-yml --- .github/workflows/ci.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a27357..4ed48b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,27 @@ -name: CI +name: CI — NexaCloud API + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + # TODO: ajouter un step "Setup Python" avec actions/setup-python@v5 + # version : "3.11" + + # TODO: ajouter un step "Installer les dépendances" + # commande : pip install -r ressources/requirements.txt + + # TODO: ajouter un step "Lancer les tests" + # commande : pytest ressources/ -vname: CI on: push: From c001ae3ddaa9816f1a79bc8bbaf6df97972ec47f Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:32:12 +0200 Subject: [PATCH 04/24] feat: correction-yml --- .github/workflows/ci.yml | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4ed48b6..670787b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,35 +7,38 @@ on: branches: [main] jobs: - test: + lint: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - # TODO: ajouter un step "Setup Python" avec actions/setup-python@v5 - # version : "3.11" - - # TODO: ajouter un step "Installer les dépendances" - # commande : pip install -r ressources/requirements.txt + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" - # TODO: ajouter un step "Lancer les tests" - # commande : pytest ressources/ -vname: CI + - name: Installer flake8 + run: pip install flake8 -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + - name: Lint avec flake8 + run: flake8 ressources/ --config ressources/.flake8 -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: Installer les dépendances + run: pip install -r ressources/requirements.txt + + - name: Lancer les tests + run: pytest ressources/ -v \ No newline at end of file From 65acbb519f7cdafe2bc0650edaec628eb23cb577 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:35:46 +0200 Subject: [PATCH 05/24] feat: ajout-bug --- ressources/app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ressources/app.py b/ressources/app.py index d7e75f2..658c52e 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -40,3 +40,7 @@ def logs_critical(): if __name__ == "__main__": app.run(debug=True, port=5001) + +bonjour +franck +barry barry; \ No newline at end of file From 7589cf638bb16d536c719036167ebc8c7ee48fa1 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:40:18 +0200 Subject: [PATCH 06/24] fix: correction-bug --- ressources/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ressources/app.py b/ressources/app.py index 658c52e..9fecd73 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -43,4 +43,4 @@ def logs_critical(): bonjour franck -barry barry; \ No newline at end of file +barry \ No newline at end of file From 104f3498b20063862abf7933186006626a54cbf0 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:42:38 +0200 Subject: [PATCH 07/24] fix: correction-bug1 --- ressources/app.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/ressources/app.py b/ressources/app.py index 9fecd73..722b0e0 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -41,6 +41,3 @@ def logs_critical(): if __name__ == "__main__": app.run(debug=True, port=5001) -bonjour -franck -barry \ No newline at end of file From b45a022b4362f4deec05b5bc87bf2e950b5b092d Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:46:10 +0200 Subject: [PATCH 08/24] fix: correctio-bug2 --- ressources/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ressources/app.py b/ressources/app.py index 722b0e0..a9817b9 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -39,5 +39,4 @@ def logs_critical(): if __name__ == "__main__": - app.run(debug=True, port=5001) - + app.run(debug=True, port=5001) \ No newline at end of file From fa77149539f18bb2c5cb779d8d966703ccdc9679 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:49:48 +0200 Subject: [PATCH 09/24] fix: correction-bug3 --- ressources/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ressources/app.py b/ressources/app.py index a9817b9..db5ddd3 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -39,4 +39,5 @@ def logs_critical(): if __name__ == "__main__": - app.run(debug=True, port=5001) \ No newline at end of file + app.run(debug=True, port=5001) + \ No newline at end of file From 3714224d542cfe93635765e7d59bf9badfad2433 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:55:00 +0200 Subject: [PATCH 10/24] fix: correction-bug4 --- ressources/app.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ressources/app.py b/ressources/app.py index db5ddd3..a9817b9 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -39,5 +39,4 @@ def logs_critical(): if __name__ == "__main__": - app.run(debug=True, port=5001) - \ No newline at end of file + app.run(debug=True, port=5001) \ No newline at end of file From 6739bff55605ed3b82209a0a9519aeae410713b3 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 14:59:05 +0200 Subject: [PATCH 11/24] fix: correctionSabotage --- ressources/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ressources/app.py b/ressources/app.py index a9817b9..d7e75f2 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -39,4 +39,4 @@ def logs_critical(): if __name__ == "__main__": - app.run(debug=True, port=5001) \ No newline at end of file + app.run(debug=True, port=5001) From 859366a9ba75bbfd27b4700b4a980d7270890ad6 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 15:06:03 +0200 Subject: [PATCH 12/24] feat: ajoutNewBug --- ressources/test_app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ressources/test_app.py b/ressources/test_app.py index ce56a43..df9bb19 100644 --- a/ressources/test_app.py +++ b/ressources/test_app.py @@ -57,3 +57,4 @@ def test_logs_critical_alerte(client): assert "critical_count" in data assert "alerte" in data assert data["alerte"] is True + assert data["info"] == 999 From f0834d1bcec0a9e948c46d4903fb02fb6d9566d2 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 15:22:54 +0200 Subject: [PATCH 13/24] fix: newBug1 --- ressources/test_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ressources/test_app.py b/ressources/test_app.py index df9bb19..9478ccf 100644 --- a/ressources/test_app.py +++ b/ressources/test_app.py @@ -57,4 +57,4 @@ def test_logs_critical_alerte(client): assert "critical_count" in data assert "alerte" in data assert data["alerte"] is True - assert data["info"] == 999 + \ No newline at end of file From 55e19f37db3cb323113dfd018fe8dad19f276b70 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 15:24:15 +0200 Subject: [PATCH 14/24] fix: correctionNewBug2 --- ressources/test_app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ressources/test_app.py b/ressources/test_app.py index 9478ccf..ce56a43 100644 --- a/ressources/test_app.py +++ b/ressources/test_app.py @@ -57,4 +57,3 @@ def test_logs_critical_alerte(client): assert "critical_count" in data assert "alerte" in data assert data["alerte"] is True - \ No newline at end of file From f408e310101d188de4d396d0751ad30d16cb4f35 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 4 Jun 2026 15:58:21 +0200 Subject: [PATCH 15/24] feat: ajoutSecret --- .github/workflows/secrets.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/secrets.yml diff --git a/.github/workflows/secrets.yml b/.github/workflows/secrets.yml new file mode 100644 index 0000000..065765e --- /dev/null +++ b/.github/workflows/secrets.yml @@ -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.MDPFRANCK != '' }}" + # ⚠️ Cette ligne sera masquée dans les logs : + echo "Valeur : ${{ secrets.MDPFRANCK }}" \ No newline at end of file From 1c3ee757d6f69d4b81a2a8d2c518ba27a25d6cf7 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Fri, 5 Jun 2026 10:17:50 +0200 Subject: [PATCH 16/24] feat: ajout-Deploy --- .github/workflows/deploy.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1c264f9 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,22 @@ +name: Deploy + +on: + workflow_dispatch: + +jobs: + deploy-staging: + runs-on: ubuntu-latest + environment: staging # utilise l'environnement staging + + steps: + - name: Déployer en staging + run: echo "Déploiement en staging..." + + deploy-production: + runs-on: ubuntu-latest + environment: production # TODO: ajouter la dépendance sur deploy-staging + needs: deploy-staging + + steps: + - name: Déployer en production + run: echo "Déploiement en production !" From c5ade71669f76c4859a494f03369682b100bb798 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Fri, 5 Jun 2026 10:29:29 +0200 Subject: [PATCH 17/24] feat: modif-yaml --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1c264f9..bdd3ce4 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,21 +2,31 @@ name: Deploy on: workflow_dispatch: + inputs: + environment: + description: "Environnement cible" + required: true + default: "staging" + type: choice + options: + - staging + - production jobs: - deploy-staging: + deploy: runs-on: ubuntu-latest - environment: staging # utilise l'environnement staging + environment: ${{ inputs.environment }} # bloqué si production nécessite une approbation steps: - - name: Déployer en staging - run: echo "Déploiement en staging..." + - name: Checkout + uses: actions/checkout@v4 - deploy-production: - runs-on: ubuntu-latest - environment: production # TODO: ajouter la dépendance sur deploy-staging - needs: deploy-staging - - steps: - - name: Déployer en production - run: echo "Déploiement en production !" + - name: Déployer sur ${{ 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 \ No newline at end of file From 93ccc92c08a17a767973bf8f3d857586adf844cc Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Fri, 5 Jun 2026 11:05:15 +0200 Subject: [PATCH 18/24] feat: CI/CD --- .github/workflows/cicd.yml | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/cicd.yml diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..2b9db71 --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,52 @@ +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 + + # TODO: ajouter le step de déploiement sur Azure App Service + # (remplacez app-name par votre nom d'application) + + # ── Job 3 : Production ──────────────────────────────────────────── + production: + runs-on: ubuntu-latest + needs: staging + environment: production + if: github.ref_name == 'main' + + steps: + - uses: actions/checkout@v4 + + # TODO: même chose pour la production From cb1e7edce60a7571bc6e0b42ae9f73504a2cd4ef Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Fri, 5 Jun 2026 11:22:54 +0200 Subject: [PATCH 19/24] feat: pre-commit --- .github/workflows/ci.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/secrets.yml | 2 +- .gitignore | 2 +- .pre-commit-config.yaml | 15 +++++++++++++++ README.md | 6 +++--- 6 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 670787b..ecb9a31 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,4 +41,4 @@ jobs: run: pip install -r ressources/requirements.txt - name: Lancer les tests - run: pytest ressources/ -v \ No newline at end of file + run: pytest ressources/ -v diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bdd3ce4..d37deff 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,4 +29,4 @@ jobs: else echo "✅ Déploiement en STAGING" echo "URL : https://staging.nexacloud.example.com" - fi \ No newline at end of file + fi diff --git a/.github/workflows/secrets.yml b/.github/workflows/secrets.yml index 065765e..236d950 100644 --- a/.github/workflows/secrets.yml +++ b/.github/workflows/secrets.yml @@ -12,4 +12,4 @@ jobs: run: | echo "La clé existe : ${{ secrets.MDPFRANCK != '' }}" # ⚠️ Cette ligne sera masquée dans les logs : - echo "Valeur : ${{ secrets.MDPFRANCK }}" \ No newline at end of file + echo "Valeur : ${{ secrets.MDPFRANCK }}" diff --git a/.gitignore b/.gitignore index 78e7733..66ee655 100644 --- a/.gitignore +++ b/.gitignore @@ -41,4 +41,4 @@ terraform.rc # Optional: ignore plan files saved before destroying Terraform configuration # Uncomment the line below if you want to ignore planout files. -# planout \ No newline at end of file +# planout diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5efc02b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,15 @@ +repos: + - repo: https://github.com/pycqa/flake8 + rev: 7.0.0 + hooks: + - id: flake8 + args: [--config, ressources/.flake8] + files: ressources/.*\.py$ + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace # supprime les espaces en fin de ligne + - id: end-of-file-fixer # ajoute un saut de ligne en fin de fichier + - id: check-yaml # valide les fichiers YAML (vos workflows !) + - id: check-merge-conflict # bloque si des marqueurs de conflit Git traînent diff --git a/README.md b/README.md index 4abe121..c264a77 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # TP GitHub Actions — CI/CD et automatisation -**Durée estimée :** 6h -**Prérequis :** Git, GitHub, bases Bash ou PowerShell (TPs précédents) +**Durée estimée :** 6h +**Prérequis :** Git, GitHub, bases Bash ou PowerShell (TPs précédents) **Environnement :** tout OS avec Git installé et un compte GitHub actif --- @@ -242,7 +242,7 @@ Commitez et pushez. Observez l'exécution dans l'onglet **Actions**. > ✏️ **À vous** > -> Ajoutez un step qui affiche la date et l'heure du runner avec `date`. +> Ajoutez un step qui affiche la date et l'heure du runner avec `date`. > Puis déclenchez le workflow **manuellement** depuis l'interface GitHub (bouton "Run workflow").
From bb28cb41d50dfcaee69a66649e06794f6154c4ed Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Fri, 5 Jun 2026 14:58:21 +0200 Subject: [PATCH 20/24] feat :modif --- ressources/__pycache__/app.cpython-314.pyc | Bin 1679 -> 1679 bytes .../test_app.cpython-314-pytest-8.2.0.pyc | Bin 10558 -> 10558 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/ressources/__pycache__/app.cpython-314.pyc b/ressources/__pycache__/app.cpython-314.pyc index d5b0916cfa751b7076ef1cf6dcbec852e7706309..b8513d284ebbca58ba1dc9d743d38ed41d348213 100644 GIT binary patch delta 20 ZcmeC@?dRpz=HumJ0D|_-N*lRb*Z?TJ1U3Kw delta 20 ZcmeC@?dRpz=HumJ0D_wyiW|9G*Z?SV1RMYW diff --git a/ressources/__pycache__/test_app.cpython-314-pytest-8.2.0.pyc b/ressources/__pycache__/test_app.cpython-314-pytest-8.2.0.pyc index c8f3ece7de3c42bf5ef64aa7490e887ee72902b9..ad4bb9010c7a6f0dd2058ddf617d1433147a3d95 100644 GIT binary patch delta 19 ZcmdlNv@eKDn~#@^0SMA-HgcJ00su0o1a<%b delta 19 ZcmdlNv@eKDn~#@^0SIn-Y~(W01OPNp1hfDE From 76d84a838db760e7871fe929a4c3de89f4a36121 Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Fri, 5 Jun 2026 15:25:59 +0200 Subject: [PATCH 21/24] feat: cette fois c'est la bonne --- .github/workflows/deploy.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d37deff..c07d543 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,3 +30,4 @@ jobs: echo "✅ Déploiement en STAGING" echo "URL : https://staging.nexacloud.example.com" fi + echo "Déploiement terminé !" From e246e5bf0346efc3701cc61ddc6c31bab009713a Mon Sep 17 00:00:00 2001 From: Franck Barry Date: Thu, 11 Jun 2026 10:15:17 +0200 Subject: [PATCH 22/24] feat: ajout-endpoint --- .github/workflows/deploy.yml | 1 - ressources/__pycache__/app.cpython-314.pyc | Bin 1679 -> 2039 bytes .../test_app.cpython-314-pytest-8.2.0.pyc | Bin 10558 -> 12759 bytes ressources/app.py | 9 +++++++++ ressources/test_app.py | 10 ++++++++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c07d543..d37deff 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,4 +30,3 @@ jobs: echo "✅ Déploiement en STAGING" echo "URL : https://staging.nexacloud.example.com" fi - echo "Déploiement terminé !" diff --git a/ressources/__pycache__/app.cpython-314.pyc b/ressources/__pycache__/app.cpython-314.pyc index b8513d284ebbca58ba1dc9d743d38ed41d348213..1ae397cdf82207f0d0fa7bd76b47d001561349c9 100644 GIT binary patch delta 444 zcmeC@{m##;&Bx2d00cMEwX!};ATdXDdC5bt=IFpJ}6SGtD%kwl@ZZQ{^<`#(q4Y`?`SAMFFMD0xFkzR2y9Ha0}hw z;GZCRgF|>q^aoaE5w_0^%slKL7?@evCo8e4G4f6JWc6e!Ql8w;s>G!WGzMf<@yp4( oSvSh@F)*>VOEyY&*j{Fo{K&-0$o`p`fl2BEi1k5WaxR+^02`T8(EtDd delta 128 zcmey)-_Ogd&Bx2d00ixum9pF>@=7x5O;rD8%M!$A5y8NaBF4ZV!w}0FAPG`}3WE59 z1cC(3nINL_3_(K5V5}*;xr6a6^WRASC%AZ=IB*%BdMNzPE|pb6|AgC7-(XV6^PIU5gtI|7H3jXYGQUu zetF*H9A2py2atpph>!*mG9bbSNEGt|2{i>IP{a-txy4_ST3iwja$G#vaYaEuQCpA( zJ4ObE28IXxqWx8!RWo!i^J`3g$dTzTb)AI@=>FtHInBu*CQX&GYO=7J8KdT8FEH7t xR?FzU`M+8KBa^1U Date: Thu, 11 Jun 2026 10:56:08 +0200 Subject: [PATCH 23/24] ajoutBug --- ressources/__pycache__/app.cpython-314.pyc | Bin 2039 -> 2039 bytes .../test_app.cpython-314-pytest-8.2.0.pyc | Bin 12759 -> 12759 bytes ressources/app.py | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ressources/__pycache__/app.cpython-314.pyc b/ressources/__pycache__/app.cpython-314.pyc index 1ae397cdf82207f0d0fa7bd76b47d001561349c9..c6b0ddc747bdc3c2a4b552af04646992e0a32255 100644 GIT binary patch delta 35 pcmey)|DB&#n~#@^0SGL!wX)uC Date: Thu, 11 Jun 2026 10:59:39 +0200 Subject: [PATCH 24/24] fix --- ressources/__pycache__/app.cpython-314.pyc | Bin 2039 -> 2039 bytes ressources/app.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ressources/__pycache__/app.cpython-314.pyc b/ressources/__pycache__/app.cpython-314.pyc index c6b0ddc747bdc3c2a4b552af04646992e0a32255..c272a304e2630cc50f0cdba47d9dc1f3d0e6f991 100644 GIT binary patch delta 19 Zcmey)|DB&pn~#@^0SKxpHgdgX2LLm41qc8D delta 19 Zcmey)|DB&pn~#@^0SGL!H*&pY2LLgx1iAnK diff --git a/ressources/app.py b/ressources/app.py index 8c29803..eee358d 100644 --- a/ressources/app.py +++ b/ressources/app.py @@ -48,4 +48,4 @@ def logs_stats(): if __name__ == "__main__": - app.run(debug=True, port=5000) + app.run(debug=True, port=5001)