Skip to content

Ajout du du dossier HTMLCOV #45

Ajout du du dossier HTMLCOV

Ajout du du dossier HTMLCOV #45

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI pipeline
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "develop" branch
push:
branches: [ "main","develop" ]
pull_request:
branches: [ "main","develop" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
ENV: 'test' #FBL : ici je précise à GIT ACTIONS d'utiliser l'environnement 'test' et non dev par défaut
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: check out du code
uses: actions/checkout@v4
- name: configuration de python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Installer uv et les dépendances
run: |
pip install uv
uv sync --frozen
- name: Lancer les tests avec couverture
run: uv run pytest --maxfail=1 --disable-warnings -q --cov=. --cov-report=html
- name: Upload du rapport HTML comme artefact
uses: actions/upload-artifact@v4
with:
name: rapport-couverture-html
path: htmlcov/
deploiement:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: déploiement sur HuggingFace
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
ENV: 'prod'
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_NAME: ${{ secrets.DB_NAME }}
run: |
pip install huggingface_hub
echo "Connexion à Hugging Face..."
hf auth login --token $HF_TOKEN
echo "Déploiement du Space Futurisys 🚀"
hf upload --repo-type space RandomFab/FUTURISYS .