Preserve typed ObjectState history across restarts #92
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, master, claude/**] | |
| pull_request: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| jobs: | |
| # Test across Python versions and OSes | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13"] | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run tests with coverage | |
| run: | | |
| pytest --cov=hieraconf --cov-report=xml --cov-report=html --cov-report=term-missing -v | |
| - name: Upload coverage to Codecov | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| fail_ci_if_error: false | |
| # Code quality checks | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Run full-package Ruff fatal checks | |
| run: | | |
| ruff check src/ --select E9,F63,F7,F82 --output-format=github | |
| - name: Resolve quality diff base | |
| id: quality-base | |
| shell: bash | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} | |
| PUSH_BASE_SHA: ${{ github.event.before }} | |
| run: | | |
| case "$EVENT_NAME" in | |
| pull_request) base_sha="$PR_BASE_SHA" ;; | |
| push) base_sha="$PUSH_BASE_SHA" ;; | |
| *) base_sha="" ;; | |
| esac | |
| if [[ -z "$base_sha" || "$base_sha" =~ ^0+$ ]] || | |
| ! git cat-file -e "${base_sha}^{commit}"; then | |
| base_sha="$(git rev-parse HEAD^)" | |
| fi | |
| echo "sha=$base_sha" >> "$GITHUB_OUTPUT" | |
| - name: Reject Ruff diagnostics introduced on added lines | |
| run: | | |
| python scripts/check_ruff_added_lines.py \ | |
| --base "${{ steps.quality-base.outputs.sha }}" \ | |
| --head "$GITHUB_SHA" | |
| - name: Report repository-wide Black baseline (non-blocking) | |
| continue-on-error: true | |
| run: | | |
| black --check src/ | |
| - name: Report repository-wide Mypy baseline (non-blocking) | |
| continue-on-error: true | |
| run: | | |
| mypy src/ --ignore-missing-imports | |
| # Documentation build check | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[docs]" | |
| - name: Build documentation | |
| run: | | |
| cd docs | |
| make html | |
| - name: Check for build warnings | |
| run: | | |
| cd docs | |
| make html SPHINXOPTS="-W --keep-going" |