Skip to content

feat(viewer): Backstage Open/Save modal conform design-spec #66

feat(viewer): Backstage Open/Save modal conform design-spec

feat(viewer): Backstage Open/Save modal conform design-spec #66

Workflow file for this run

# GitHub Actions Workflow: Test Suite with Coverage
# Runs pytest with coverage on all supported Python versions
# Enforces 80% coverage threshold as merge gate
name: Test Suite
on:
push:
branches:
- main
- master
- develop
pull_request:
branches:
- main
- master
- develop
workflow_dispatch: # Allow manual trigger
env:
PYTHONDONTWRITEBYTECODE: 1
PYTHONUNBUFFERED: 1
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", "3.12"]
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 ".[dev]"
- name: Run tests with coverage
run: |
python -m pytest \
--cov=src/ifc_validator \
--cov=server \
--cov-report=term-missing \
--cov-report=xml:coverage.xml \
--cov-report=html:htmlcov \
--cov-fail-under=80 \
--junitxml=test-results.xml \
-v
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: matrix.python-version == '3.11' # Only upload once
with:
name: coverage-report
path: |
coverage.xml
htmlcov/
retention-days: 30
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.python-version }}
path: test-results.xml
retention-days: 30
# Coverage summary job - posts coverage to PR
coverage-report:
name: Coverage Report
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download coverage artifact
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: Post coverage comment to PR
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERAGE_PATH: coverage.xml
MINIMUM_GREEN: 80
MINIMUM_ORANGE: 60
# Lint job - ensures code quality
lint:
name: Lint & Format Check
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.11"
cache: 'pip'
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Check formatting with Black
run: black --check .
- name: Lint with Ruff
run: ruff check .
# Final status check - acts as merge gate
all-checks:
name: All Checks Passed
runs-on: ubuntu-latest
needs: [test, lint]
if: always()
steps:
- name: Check test results
run: |
if [[ "${{ needs.test.result }}" != "success" ]]; then
echo "Tests failed or were cancelled"
exit 1
fi
if [[ "${{ needs.lint.result }}" != "success" ]]; then
echo "Linting failed"
exit 1
fi
echo "All checks passed!"