Add tests (#346)
Signed-off-by: Glenn Jocher <[email protected]> Co-authored-by: UltralyticsAssistant <[email protected]>
This commit is contained in:
co-authored by
UltralyticsAssistant
parent
5d47f4b7da
commit
ceb77ffc3a
@@ -0,0 +1,41 @@
|
||||
# Ultralytics Template 🚀, AGPL-3.0 license
|
||||
# Continuous Integration (CI) GitHub Actions tests
|
||||
|
||||
name: Actions CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: "0 0 * * *" # Runs at 00:00 UTC every day
|
||||
|
||||
jobs:
|
||||
Test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
python-version: ["3.12", "3.13"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- uses: astral-sh/setup-uv@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv pip install --system -e ".[dev]"
|
||||
|
||||
- name: Run Python tests
|
||||
run: |
|
||||
python -m pytest tests
|
||||
|
||||
- name: Run CLI tests
|
||||
run: |
|
||||
ultralytics-actions-info
|
||||
+1
-1
@@ -157,4 +157,4 @@ cython_debug/
|
||||
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
.idea/
|
||||
|
||||
+1
-1
@@ -22,4 +22,4 @@
|
||||
# ├── test_summarize_pr.py
|
||||
# └── ...
|
||||
|
||||
__version__ = "0.0.35"
|
||||
__version__ = "0.0.36"
|
||||
|
||||
@@ -5,6 +5,8 @@ import time
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from urllib import parse
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
def remove_html_comments(body: str) -> str:
|
||||
"""Removes HTML comments from a string using regex pattern matching."""
|
||||
|
||||
@@ -73,7 +73,6 @@ dependencies = [
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"pytest",
|
||||
"black",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from actions.utils.common_utils import is_url
|
||||
|
||||
URLS = [
|
||||
"https://docs.ultralytics.com/help/CLA/",
|
||||
"https://docs.ultralytics.com/help/contributing",
|
||||
"https://docs.ultralytics.com",
|
||||
"https://ultralytics.com",
|
||||
"https://github.com/ultralytics/ultralytics",
|
||||
]
|
||||
|
||||
|
||||
def test_urls():
|
||||
"""Test each URL using is_url function."""
|
||||
for url in URLS:
|
||||
assert is_url(url), f"URL check failed: {url}"
|
||||
Reference in New Issue
Block a user