Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/B3-3iL-DLW/3il-student into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
PHPLukaas committed Mar 12, 2024
2 parents 4a75feb + 4a23279 commit e4982bb
Show file tree
Hide file tree
Showing 22 changed files with 587 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: SSH Upload and Composer Install on DEV
name: Upload backend to dev server and lint

on:
push:
branches:
- dev
pull_request:
branches:
- dev

env:
FLUTTER_VERSION: 3.10.1

jobs:
deploy:
Expand All @@ -21,12 +27,31 @@ jobs:
- name: Upload PHP code
run: scp -o StrictHostKeyChecking=no -r * ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}:/home/julesartd/www/api-dev-edt-3il

- name: SSH into server and run composer install

install_dependencies:
needs: deploy
runs-on: ubuntu-latest

steps:
- name: SSH Into Server and Install Composer Dependencies
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/julesartd/www/api-dev-edt-3il/backend
composer2 install
composer2 install
- name: SSH Into Server and execute Linter for PHP
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/julesartd/www/api-dev-edt-3il/backend
vendor/bin/php-cs-fixer fix src


39 changes: 39 additions & 0 deletions .github/workflows/execute-linter-front.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Execute Lint and Format

concurrency:
group: $-$
cancel-in-progress: true

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

env:
FLUTTER_VERSION: 3.19.2

jobs:
format-lint:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
cache: true
cache-key: ":os:-modules-:hash:"
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}

- name: Formatting
run: dart --disable-analytics format --set-exit-if-changed frontend/app_student/lib

- name: Lint
run: flutter analyze lib
5 changes: 5 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@
/var/
/vendor/
###< symfony/framework-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
13 changes: 13 additions & 0 deletions backend/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude('var')
;

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
])
->setFinder($finder)
;
3 changes: 2 additions & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ Pour installer l'API et ses dépendances, suivez les étapes ci-dessous :
3. Exécutez la commande `composer install` pour installer toutes les dépendances nécessaires.



## Endpoints

L'API offre les endpoints suivants :

- `/api/timetable?class_param=XX` : Permet de récupérer l'emploi du temps d'une classe spécifique.
- `/api/classes` : Permet de récupérer la liste des classes disponibles.

Vous pouvez retrouver la spécification OpenApi à la racine du projet Symfony

## Utilisation

Une fois l'API installée et configurée, vous pouvez commencer à l'utiliser en effectuant des requêtes HTTP vers les endpoints mentionnés ci-dessus. Assurez-vous de respecter les méthodes HTTP appropriées (GET, POST, etc.) pour interagir avec les données de l'API.
Expand Down
1 change: 1 addition & 0 deletions backend/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"symfony/yaml": "6.4.*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.51",
"symfony/debug-bundle": "6.4.*",
"symfony/maker-bundle": "^1.56"
},
Expand Down
Loading

0 comments on commit e4982bb

Please sign in to comment.