name: CI Pipeline on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-latest env: ENV: test steps: - name: Checkout du code uses: actions/checkout@v3 - name: Configuration de Python uses: actions/setup-python@v4 with: python-version: "3.12" - name: Run tests with coverage (terminal) run: | pip install uv uv run pytest --cov=app --cov-report=term-missing - name: Generate HTML coverage report run: | pip install uv uv run pytest --cov=app --cov-report=html - name: Upload coverage HTML report uses: actions/upload-artifact@v4 with: name: coverage-report path: htmlcov/ - name: Check Python syntax run: python -m py_compile $(git ls-files '*.py') deploy: needs: build runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v3 - name: Install Hugging Face CLI run: pip install huggingface_hub - name: Deploy to Hugging Face Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | echo "Connexion à Hugging Face..." hf auth login --token $HF_TOKEN echo "Déploiement du Space 🚀" hf upload --repo-type space PCelia/futurisys-api .