Repository navigation
Build the docker image on an OSDC runner #14399
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: Lint Code | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, ready_for_review, review_requested, reopened] | |
| jobs: | |
| cpp-linting: | |
| name: C++ Linting | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| checks: write | |
| contents: write | |
| deployments: none | |
| id-token: write | |
| issues: write | |
| discussions: write | |
| packages: write | |
| pull-requests: write | |
| repository-projects: none | |
| security-events: none | |
| statuses: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup env | |
| run: | | |
| sudo ln -s $GITHUB_EVENT_PATH /GITHUB_EVENT.json | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Install dependencies | |
| run: | | |
| uv pip install --system -r $GITHUB_WORKSPACE/.github/scripts/requirements.txt | |
| python3 -c "import tomllib, subprocess; deps = tomllib.load(open('pyproject.toml', 'rb'))['dependency-groups']['lint']; subprocess.run(['uv', 'pip', 'install', '--system'] + deps, check=True)" | |
| - name: Lint C++ | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| python3 $GITHUB_WORKSPACE/.github/scripts/run_cpp_linter.py | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| py-linting: | |
| name: Python Linting | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| checks: write | |
| contents: write | |
| deployments: none | |
| id-token: write | |
| issues: write | |
| discussions: write | |
| packages: write | |
| pull-requests: write | |
| repository-projects: none | |
| security-events: none | |
| statuses: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Setup env | |
| run: | | |
| sudo ln -s $GITHUB_EVENT_PATH /GITHUB_EVENT.json | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Install dependencies | |
| run: | | |
| uv pip install --system -r $GITHUB_WORKSPACE/.github/scripts/requirements.txt | |
| python3 -c "import tomllib, subprocess; deps = tomllib.load(open('pyproject.toml', 'rb'))['dependency-groups']['lint']; subprocess.run(['uv', 'pip', 'install', '--system'] + deps, check=True)" | |
| - name: Lint Python | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| python3 $GITHUB_WORKSPACE/.github/scripts/run_py_linter.py | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| # These source checks need no GPU; --noconftest avoids importing torch. | |
| - name: Check the ExecuTorch pin is consistent | |
| if: always() | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| python3 -m pytest tests/py/dynamo/executorch/test_executorch_pin.py \ | |
| -q --no-header -p no:cacheprovider --noconftest -o addopts="" | |
| - name: Test the ExecuTorch pin updater | |
| if: always() | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| python3 -m pytest tests/py/dynamo/executorch/test_update_executorch_pin.py \ | |
| -q --no-header -p no:cacheprovider --noconftest -o addopts="" | |
| # The rest of the ExecuTorch suite that needs no GPU. Without this the only lane running these | |
| # is nightly, so a pull request could not fail on anything they cover, and they cover the | |
| # packaging, the wheel guard, the shipped CMake package and the shared workflow. | |
| - name: Check the ExecuTorch packaging and workflow | |
| if: always() | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| python3 -m pytest \ | |
| tests/py/dynamo/executorch/test_packaging.py \ | |
| tests/py/dynamo/executorch/test_artifact_guard.py \ | |
| tests/py/dynamo/executorch/test_shared_runtime_workflow.py \ | |
| tests/py/dynamo/executorch/test_example_boundaries.py \ | |
| tests/py/dynamo/executorch/test_cmake_runtime.py \ | |
| tests/py/dynamo/executorch/test_python_runtime.py \ | |
| -q --no-header -p no:cacheprovider --noconftest -o addopts="" | |
| # The two files that import torch at module level. A CPU build is enough: both read source, | |
| # packaging metadata and workflow text, and neither runs a model. Nightly was the only lane | |
| # running them, so a pull request could not fail on the loader compatibility paths or the | |
| # release matrix gates they cover. | |
| - name: Check the ExecuTorch API and loader compatibility | |
| if: always() | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu | |
| python3 -m pytest \ | |
| tests/py/dynamo/executorch/test_api.py \ | |
| tests/py/dynamo/executorch/test_load_compatibility.py \ | |
| -q --no-header -p no:cacheprovider --noconftest -o addopts="" |