| name: CI Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.10" # Match your project's Python version | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Lint and Test Code | |
| run: | | |
| python -m compileall app.py # Check for syntax errors | |
| # Add additional test commands if applicable | |
| - name: Launch Gradio App (Validation) | |
| run: | | |
| python app.py & | |
| sleep 10 # Wait for the app to initialize | |
| curl -f http://127.0.0.1:7860 || exit 1 # Ensure the app runs successfully | |
| - name: Check for dependency updates | |
| run: pip list --outdated | |