mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 11:04:36 +00:00
add auto testing
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
name: Run Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["*"] # Run on all branches
|
||||
pull_request:
|
||||
branches: ["*"] # Run on PRs to all branches
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v3
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
run: uv python install ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
uv sync --dev
|
||||
|
||||
- name: Run linting with ruff
|
||||
run: |
|
||||
uv run ruff check .
|
||||
|
||||
- name: Run type checking with mypy
|
||||
run: |
|
||||
uv run mypy .
|
||||
|
||||
- name: Run tests with pytest
|
||||
run: |
|
||||
uv run pytest --verbose --tb=short
|
||||
|
||||
- name: Upload test results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: test-results-${{ matrix.python-version }}
|
||||
path: |
|
||||
pytest.xml
|
||||
.coverage
|
||||
retention-days: 30
|
||||
Reference in New Issue
Block a user