-
-
Notifications
You must be signed in to change notification settings - Fork 2
73 lines (67 loc) · 2.37 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Ultralytics HUB-SDK 🚀, AGPL-3.0 license
# HUB-SDK Continuous Integration (CI) GitHub Actions tests
name: HUB-SDK CI
on:
push:
branches: [main]
pull_request_target:
branches: [main]
schedule:
- cron: "0 0 * * *" # runs at 00:00 UTC every day
workflow_dispatch:
env:
FIREBASE_CRED: ${{ secrets.FIREBASE_CRED }}
ULTRALYTICS_HUB_API: ${{ vars.ULTRALYTICS_HUB_API }}
ULTRALYTICS_HUB_WEB: ${{ vars.ULTRALYTICS_HUB_WEB }}
BUCKET_NAME: ${{ vars.BUCKET_NAME }}
jobs:
Docs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
cache: "pip" # caching pip dependencies
- name: Install Dependencies
run: |
pip install -e ".[dev]"
shell: bash
- name: Build Docs and Check for Warnings
run: |
mkdocs build --strict
shell: bash
Tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: |
cd tests
pip install -r requirements.txt
- name: Download Test Data
run: |
cd tests
python utils/test_data.py download
- name: Run pytest
run: python -m pytest -v -m "smoke" tests
Summary:
runs-on: ubuntu-latest
needs: [Docs, Tests] # Add job names that you want to check for failure
if: always() # This ensures the job runs even if previous jobs fail
steps:
- name: Check for failure and notify
if: (needs.Docs.result == 'failure' || needs.Tests.result == 'failure') && github.repository == 'ultralytics/hub-sdk' && (github.event_name == 'schedule' || github.event_name == 'push')
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{"text": "<!channel> GitHub Actions error for ${{ github.workflow }} ❌\n\n\n*Repository:* https://github.com/${{ github.repository }}\n*Action:* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\n*Author:* ${{ github.actor }}\n*Event:* ${{ github.event_name }}\n"}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_HUBWEB }}