[CI] Enable model revisions in GHA test #2058
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: Type Check | |
on: | |
# Don't use `paths` or `paths-ignore` filter since this workflow is required | |
# for all pull requests on main irrespective of file type or location | |
# Use `changed-src-files` step to determine if source code was changed | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
type-check: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.11", "3.12"] | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Get changed source files" | |
id: changed-src-files | |
uses: tj-actions/changed-files@v46 | |
with: # Avoid using single or double quotes for multiline patterns | |
files: | | |
.github/workflows/type_check.yaml | |
tools/type_check.sh | |
pyproject.toml | |
**.py | |
- name: "Set up Python ${{ matrix.python-version }}" | |
if: steps.changed-src-files.outputs.any_changed == 'true' | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
enable-cache: true | |
ignore-nothing-to-cache: true | |
cache-dependency-glob: | | |
pyproject.toml | |
- name: "Install dependencies" | |
if: steps.changed-src-files.outputs.any_changed == 'true' | |
run: uv sync --frozen --only-group lint | |
- name: "Run mypy" | |
if: steps.changed-src-files.outputs.any_changed == 'true' | |
run: | | |
echo "::add-matcher::.github/workflows/matchers/mypy.json" | |
tools/type_check.sh 1 ${{ matrix.python-version }} |