Skip to content

Add tests to CI

Add tests to CI #25

Workflow file for this run

# Ultralytics HUB-SDK 🚀, AGPL-3.0 license
# HUB-SDK Continuous Integration (CI) GitHub Actions tests
name: HUB-SDK CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
schedule:
- cron: "0 0 * * *" # runs at 00:00 UTC every day
workflow_dispatch:
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:
timeout-minutes: 60
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.11"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip" # caching pip dependencies
- name: Install requirements
shell: bash # for Windows compatibility
run: |
pip install -e ".[dev]"
- name: Check environment
run: |
pip list
- name: Pytest tests
shell: bash # for Windows compatibility
run: |
pytest --cov=hub_sdk/ --cov-report xml tests/
- name: Upload Coverage Reports to CodeCov
if: github.repository == 'ultralytics/ultralytics' # && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v3
with:
flags: Tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}