Skip to content

Feature: add AutoML tabular sample (#44) #2

Feature: add AutoML tabular sample (#44)

Feature: add AutoML tabular sample (#44) #2

name: Notebook Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
name: Validation & Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Run validation tests
run: |
pytest tests/validation/ -v --tb=short --junit-xml=validation-results.xml | tee validation-output.txt
continue-on-error: true
- name: Run smoke tests
run: |
pytest tests/examples/ -v --tb=short --junit-xml=smoke-results.xml | tee smoke-output.txt
continue-on-error: true
- name: Check test results
run: |
# Fail the workflow if any tests failed (excluding validation warnings)
grep -q "failed" validation-output.txt && exit 1 || true
grep -q "failed" smoke-output.txt && exit 1 || true
exit 0
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
validation-results.xml
smoke-results.xml
validation-output.txt
smoke-output.txt
retention-days: 7
- name: Generate test summary
if: always()
run: |
echo "## Test Results" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Extract validation warnings section
echo "### Validation Tests" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# Check if there are validation warnings
if grep -q "Validation Warnings Summary" validation-output.txt; then
echo "**Validation Warnings Found:**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
sed -n '/Validation Warnings Summary/,/passed\|failed\|error/p' validation-output.txt | head -n -1 >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
else
echo "No validation warnings." >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
# Show test result summary line
echo "**Result:** $(tail -n 1 validation-output.txt)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Smoke Tests" >> $GITHUB_STEP_SUMMARY
echo "**Result:** $(tail -n 1 smoke-output.txt)" >> $GITHUB_STEP_SUMMARY