add examples #336
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] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| - '.gitignore' | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '*.md' | |
| - '.gitignore' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ci-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pre-commit | |
| - name: Run pre-commit | |
| env: | |
| SKIP: no-commit-to-branch | |
| run: pre-commit run --all-files --show-diff-on-failure | |
| test-core: | |
| name: Core Tests (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # PRs only run on 3.10. Main branch and manual dispatches run on all versions. | |
| python-version: >- | |
| ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && | |
| fromJSON('["3.10", "3.11", "3.12", "3.13"]') || | |
| fromJSON('["3.10"]') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - 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 | |
| - name: Run core tests | |
| run: | | |
| pytest \ | |
| tests/core \ | |
| tests/diagnostics/test_bands.py \ | |
| tests/diagnostics/test_common.py \ | |
| tests/telemetry/test_distributed.py \ | |
| tests/telemetry/test_msgpack.py \ | |
| tests/telemetry/test_sender_sequence.py \ | |
| -q | |
| test-integration: | |
| name: Integration Smoke Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[torch]" | |
| pip install pytest | |
| - name: Run integration tests | |
| run: | | |
| pytest \ | |
| tests/runtime/test_sampler_registry.py \ | |
| tests/runtime/test_telemetry_publisher.py \ | |
| tests/reporting/compare \ | |
| tests/reporting/html \ | |
| -q | |
| smoke-test-install: | |
| name: Clean-install Smoke Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Build the wheel | |
| run: | | |
| python -m pip install --upgrade pip build | |
| python -m build --wheel | |
| - name: Install the built wheel into a clean environment | |
| run: | | |
| python -m venv /tmp/smoke-env | |
| /tmp/smoke-env/bin/pip install --upgrade pip | |
| /tmp/smoke-env/bin/pip install dist/*.whl | |
| - name: Assert documented CLI surface is installed | |
| run: | | |
| /tmp/smoke-env/bin/traceml --help | grep -q 'view' || \ | |
| (echo "::error::traceml --help is missing the documented 'view' subcommand" && exit 1) | |
| /tmp/smoke-env/bin/traceml run --help | grep -q 'html-report' || \ | |
| (echo "::error::traceml run --help is missing the documented '--html-report' flag" && exit 1) |