Skip to content

Merge pull request #17 from hangtime79/fix/schema-extractor-lint #29

Merge pull request #17 from hangtime79/fix/schema-extractor-lint

Merge pull request #17 from hangtime79/fix/schema-extractor-lint #29

Workflow file for this run

name: Tests
on:
push:
branches:
- master
- main
pull_request:
branches:
- '**'
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '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 -e .
pip install pytest pytest-cov pytest-xdist pytest-mock pyyaml
- name: Run unit tests with coverage
run: |
pytest tests/iac/unit/ \
--cov=dataikuapi.iac \
--cov-report=xml \
--cov-report=term-missing \
--cov-report=html \
-v \
--tb=short
- name: Run integration tests
run: |
pytest tests/iac/integration/ \
--cov=dataikuapi.iac \
--cov-append \
--cov-report=xml \
--cov-report=term-missing \
-v \
--tb=short
- name: Run scenario tests
run: |
pytest tests/iac/scenarios/ \
--cov=dataikuapi.iac \
--cov-append \
--cov-report=xml \
--cov-report=term-missing \
-v \
--tb=short
- name: Run remaining IaC tests
run: |
pytest tests/iac/ \
--ignore=tests/iac/unit/ \
--ignore=tests/iac/integration/ \
--ignore=tests/iac/scenarios/ \
--cov=dataikuapi.iac \
--cov-append \
--cov-report=xml \
--cov-report=term-missing \
-v \
--tb=short
- name: Check coverage threshold
run: |
coverage report --fail-under=80
- name: Upload coverage to Codecov
if: matrix.python-version == '3.10'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
- name: Archive coverage reports
if: matrix.python-version == '3.10'
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
coverage.xml
htmlcov/
retention-days: 7
- name: Test summary
if: always()
run: |
echo "## Test Results for Python ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "✅ Tests completed" >> $GITHUB_STEP_SUMMARY