feat(ocl): add Synaptic Intelligence (SI) strategy #1139
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| # TODO: In the future we ought to perform code coverage checks | |
| name: Pull Request | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| env: | |
| PYTHON_VERSION: "3.10" | |
| jobs: | |
| tests: | |
| name: "Tests" | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| # For Pull Requests we run tests on Ubuntu with Python 3.10. | |
| # In releases we will test on more configurations. | |
| operating-system: | |
| - ubuntu-latest | |
| # - windows-latest | |
| # - macos-latest | |
| python-version: | |
| - '3.10' | |
| # - '3.11' | |
| # - '3.12' | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| # diff-cover needs more history to compute coverage diffs | |
| fetch-depth: 10 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| enable-cache: true | |
| - name: Cache Test Datasets | |
| id: cache-test-datasets | |
| uses: actions/cache@v4 | |
| with: | |
| path: data | |
| key: "test-datasets" | |
| # Run ALL tests that do NOT require any optional dependencies. | |
| - name: PyTest (base) | |
| run: >- | |
| uv --quiet run --exact | |
| --extra dev | |
| invoke test.pytest --coverage | |
| env: | |
| PYTEST_ADDOPTS: -m "not torch" | |
| COVERAGE_FILE: .coverage.pytest-base | |
| # Run ONLY tests marked as requiring the PyTorch optional dependency. | |
| - name: PyTest (torch) | |
| run: >- | |
| uv --quiet run --exact | |
| --extra dev --extra torch-cpu | |
| invoke test.pytest --coverage | |
| env: | |
| PYTEST_ADDOPTS: -m "torch" | |
| COVERAGE_FILE: .coverage.pytest-torch | |
| - name: Doctest | |
| run: >- | |
| uv --quiet run --exact | |
| --extra dev --extra torch-cpu | |
| invoke test.doctest --coverage | |
| - name: Check Notebooks | |
| run: >- | |
| uv --quiet run --exact | |
| --extra dev --extra torch-cpu | |
| invoke test.nb | |
| - name: Combine Test Coverages & Generate XML Report | |
| run: | | |
| uv run invoke test.cov-combine | |
| uv run coverage xml -i | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| files: coverage.xml | |
| lint: | |
| name: "Code Style" | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Formatting | |
| uses: astral-sh/ruff-action@v3 | |
| with: | |
| args: "format --check" | |
| - name: Linting | |
| uses: astral-sh/ruff-action@v3 | |
| commit: | |
| name: "Commit Style" | |
| runs-on: ubuntu-latest | |
| # Only report commit style issues on push to main, not on PRs as contributors seldom | |
| # want to worry about fixing commit messages. The reviewer will `squash and merge` | |
| # with a proper commit message. | |
| if: github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: wagoid/commitlint-github-action@v6 | |
| documentation: | |
| name: "Documentation" | |
| timeout-minutes: 20 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: ${{ env.PYTHON_VERSION }} | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt-get install -y pandoc | |
| - name: Build Documentation | |
| run: >- | |
| uv --quiet run --exact | |
| --extra dev --extra doc --extra torch-cpu | |
| invoke docs.build | |
| - name: Artifact name | |
| run: echo DOC_ARTIFACT_NAME=doc-${GITHUB_REF//\//-} >> $GITHUB_ENV | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.DOC_ARTIFACT_NAME }} | |
| retention-days: 14 | |
| path: docs/_build | |
| overwrite: true |