67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
name: Unit and Integration Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master, develop]
|
|
pull_request:
|
|
branches: [main, master, develop]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11"]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'pip'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pytest pytest-cov pytest-mock pytest-asyncio
|
|
pip install -r requirements.txt
|
|
pip install -r requirements-dev.txt
|
|
|
|
- name: Run unit tests
|
|
run: |
|
|
pytest tests/unit/ -v --cov=nodes --cov-report=xml --cov-report=term-missing
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
- name: Run mocked integration tests
|
|
run: |
|
|
pytest tests/integration/ -v --cov=nodes --cov-append --cov-report=xml --cov-report=term-missing
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
- name: Run workflow validation tests
|
|
run: |
|
|
pytest tests/workflows/ -v
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
|
|
- name: Upload coverage reports
|
|
uses: codecov/codecov-action@v4
|
|
if: matrix.python-version == '3.10'
|
|
with:
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: false
|
|
|
|
- name: Test summary
|
|
if: always()
|
|
run: |
|
|
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ Unit tests completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ Mocked integration tests completed" >> $GITHUB_STEP_SUMMARY
|
|
echo "✅ Workflow validation tests completed" >> $GITHUB_STEP_SUMMARY
|