Spaces:
Sleeping
Sleeping
Download .github/workflows/test-workflow.yml from sanjeethnc/MLopsLocal: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/spaces/sanjeethnc/MLopsLocal/resolve/main/.github/workflows/test-workflow.yml
- Command line
-
hf download hf://spaces/sanjeethnc/MLopsLocal/.github/workflows/test-workflow.yml
-
curl -L -o test-workflow.yml https://huggingface.co/spaces/sanjeethnc/MLopsLocal/resolve/main/.github/workflows/test-workflow.yml
1.07 kB
| name: Run Tests on Push | |
| on: | |
| push: | |
| branches: | |
| - main # Change this to the branch you want to trigger testing | |
| jobs: | |
| run-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # Step 2: Set up Python | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11.4' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| - name: Run unittest | |
| run: | | |
| python -m unittest discover -s . -p 'test_app.py' | |
| - name: Send Discord Notification | |
| if: failure() | |
| run: | | |
| curl -H "Content-Type: application/json" \ | |
| -d "{\"username\": \"GitHub Bot\", \"content\": \"❌ **Test failure in repository: ${{ github.repository }}** on branch **${{ github.ref_name }}**. [Check logs](${{ | |
| github.event.compare }})\"}" \ | |
| ${{ secrets.DISCORD_WEBHOOK_URL }} | |