docs(sdk): link runtime and specs references #4
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] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: Pre-commit (lint + format + hygiene) | |
| env: | |
| SKIP: no-commit-to-branch | |
| run: | | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| FROM_REF="${{ github.event.pull_request.base.sha }}" | |
| TO_REF="${{ github.event.pull_request.head.sha }}" | |
| else | |
| FROM_REF="${{ github.event.before }}" | |
| TO_REF="${{ github.sha }}" | |
| fi | |
| # Some event refs may not exist in shallow/partial clones. | |
| # If either commit is unavailable, fall back to all-files mode. | |
| if ! git cat-file -e "${FROM_REF}^{commit}" 2>/dev/null || ! git cat-file -e "${TO_REF}^{commit}" 2>/dev/null; then | |
| echo "Pre-commit refs unavailable in checkout (from=$FROM_REF to=$TO_REF); running all-files." | |
| pre-commit run --show-diff-on-failure --all-files | |
| exit $? | |
| fi | |
| if echo "$FROM_REF" | grep -Eq '^0+$'; then | |
| echo "Running pre-commit on all files (no valid base ref)" | |
| pre-commit run --show-diff-on-failure --all-files | |
| else | |
| echo "Running pre-commit from $FROM_REF to $TO_REF" | |
| pre-commit run --show-diff-on-failure --from-ref "$FROM_REF" --to-ref "$TO_REF" | |
| fi | |
| - name: Run tests | |
| run: pytest -q | |
| - name: Run ruff lint | |
| run: ruff check . | |
| - name: Run ruff format check | |
| run: ruff format --check . | |
| - name: Run mypy | |
| run: mypy ori_sdk |