README: enhance build instructions #32781
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: Lint | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| # the most recent commit in the PR would cancel older commit's in-progress workflows | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id}} | |
| cancel-in-progress: true | |
| env: | |
| working_directory: . | |
| jobs: | |
| check-license: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Look for missing license headers | |
| working-directory: ${{ env.working_directory }} | |
| run: | | |
| find . -regextype posix-extended -regex '.*\.(cpp|h|py|md|svg)' | egrep -v '^./(\.|third_party|bin|build|nvfuser/include|nvfuser/version.py|tools/linter/adapters)' | xargs grep -L SPDX-FileCopyrightText | tee missing-header-files.txt | |
| # test that file is empty | |
| test ! -s missing-header-files.txt | |
| clang-tidy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Run lintrunner | |
| working-directory: ${{ env.working_directory }} | |
| run: | | |
| tools/apt-install-things.sh & | |
| tools/pip-install-things.sh & | |
| wait | |
| source tools/setup-env.sh | |
| # Install lintrunner | |
| pip install lintrunner | |
| # Initialize lintrunner | |
| lintrunner init 2> /dev/null | |
| # Go to python folder to build cmake files | |
| cd python | |
| # Run cmake build | |
| NVFUSER_BUILD_CMAKE_ONLY=1 python setup.py | |
| # Return to root to run clang-tidy | |
| cd .. | |
| # Run lintrunner on all csrc files exclude benchmark and test folders | |
| base_ref="${{ github.base_ref || 'main' }}" | |
| git fetch origin $base_ref | |
| head_commit=$(git rev-parse FETCH_HEAD) | |
| # diff-filter for lower case letter: | |
| # https://github.com/git/git/commit/7f2ea5f0f2fb056314092cce23202096ca70f076 | |
| git --no-pager diff --diff-filter=d --name-only $head_commit | grep -e "csrc/.*\.cpp" -e "csrc/.*\.h" | xargs lintrunner --take CLANGTIDY --force-color | |
| lintrunner: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Run lintrunner | |
| working-directory: ${{ env.working_directory }} | |
| run: | | |
| tools/apt-install-things.sh & | |
| tools/pip-install-things.sh & | |
| wait | |
| source tools/setup-env.sh | |
| # Install lintrunner | |
| pip install lintrunner | |
| # Initialize lintrunner | |
| lintrunner init 2> /dev/null | |
| # Install dependencies | |
| sudo apt install -y libtinfo6 | |
| # Run lintrunner except clang-tidy | |
| lintrunner --force-color --take FLAKE8,MYPY,CLANGFORMAT,NOQA,TYPEIGNORE,NEWLINE,MYPYSTRICT,TABS,SPACES,EXEC,BLACK,TORCH_INTERNAL_ASSERT,TORCH_CHECK,C10_ERROR,TORCH_CUDA_CU_API --all-files |