Allow specializing Anything type variables via isinstance #701
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: Tests & QA | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| paths: | |
| - 'examples/**.py' | |
| - 'opshin/**.py' | |
| - 'tests/**.py' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - '.github/workflows/tests.yml' | |
| - '.github/scripts/run-tests.sh' | |
| - '.github/actions/get-python-versions/**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| paths: | |
| - 'examples/**.py' | |
| - 'opshin/**.py' | |
| - 'tests/**.py' | |
| - 'pyproject.toml' | |
| - 'poetry.lock' | |
| - '.github/workflows/tests.yml' | |
| - '.github/scripts/run-tests.sh' | |
| - '.github/actions/get-python-versions/**' | |
| jobs: | |
| check-run: | |
| # continue-on-error: true # Uncomment once integration is finished | |
| runs-on: ubuntu-latest | |
| # Map a step output to a job output | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@v5 | |
| with: | |
| # All of these options are optional, so you can remove them if you are happy with the defaults | |
| concurrent_skipping: 'same_content_newer' | |
| skip_after_successful_duplicate: 'true' | |
| do_not_skip: '["workflow_dispatch", "schedule"]' | |
| get-python-versions: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| maximum-version: ${{ steps.get-versions.outputs.maximum-version }} | |
| minimum-version: ${{ steps.get-versions.outputs.minimum-version }} | |
| other-versions: ${{ steps.get-versions.outputs.other-versions }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Get Python versions | |
| id: get-versions | |
| uses: ./.github/actions/get-python-versions | |
| test-primary: | |
| needs: | |
| - get-python-versions | |
| - check-run | |
| if: needs.check-run.outputs.should_skip != 'true' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: | |
| - "${{ needs.get-python-versions.outputs.maximum-version }}" | |
| - "${{ needs.get-python-versions.outputs.minimum-version }}" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install project | |
| run: uv sync --dev | |
| - name: Run tests | |
| run: bash .github/scripts/run-tests.sh | |
| - name: Upload coverage data to coveralls.io | |
| run: | | |
| uv pip install --upgrade coveralls || true | |
| uv run coveralls || true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
| COVERALLS_PARALLEL: true | |
| test-other: | |
| needs: [get-python-versions, test-primary] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ${{ fromJSON(needs.get-python-versions.outputs.other-versions) }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install project | |
| run: uv sync --dev | |
| - name: Run tests | |
| run: bash .github/scripts/run-tests.sh | |
| - name: Upload coverage data to coveralls.io | |
| run: | | |
| uv pip install --upgrade coveralls || true | |
| uv run coveralls || true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | |
| COVERALLS_PARALLEL: true | |
| coveralls: | |
| name: Indicate completion to coveralls.io | |
| needs: [test-primary, test-other] | |
| runs-on: ubuntu-latest | |
| container: python:3-slim | |
| steps: | |
| - name: Install coveralls | |
| run: pip3 install --upgrade coveralls | |
| - name: Finished | |
| run: coveralls --finish || true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |