Lines Matching +full:check +full:- +full:clang +full:- +full:python
1 name: "Check code formatting"
9 - main
10 - 'users/**'
14 runs-on: ubuntu-latest
15 timeout-minutes: 30
17 group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
18 cancel-in-progress: true
19 if: github.repository == 'llvm/llvm-project'
21 - name: Fetch LLVM sources
26 - name: Checkout through merge base
27 uses: rmacklin/fetch-through-merge-base@v0
33 - name: Get changed files
34 id: changed-files
35 uses: tj-actions/changed-files@v39
42 - name: Fetch code formatting utils
47 sparse-checkout: |
49 llvm/utils/git/code-format-helper.py
50 sparse-checkout-cone-mode: false
51 path: code-format-tools
53 - name: "Listed files"
55 CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
60 - name: Install clang-format
61 uses: aminya/setup-cpp@v1
65 - name: Setup Python env
66 uses: actions/setup-python@v5
68 python-version: '3.11'
70 cache-dependency-path: 'code-format-tools/llvm/utils/git/requirements_formatting.txt'
72 - name: Install python dependencies
73 run: pip install -r code-format-tools/llvm/utils/git/requirements_formatting.txt
75 - name: Run code formatter
80 CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
81 # TODO(boomanaiden154): Once clang v18 is released, we should be able
82 # to take advantage of the new --diff_from_common_commit option
83 # explicitly in code-format-helper.py and not have to diff starting at
85 # Create an empty comments file so the pr-write job doesn't fail.
88 python ./code-format-tools/llvm/utils/git/code-format-helper.py \
89 --write-comment-to-file \
90 --token ${{ secrets.GITHUB_TOKEN }} \
91 --issue-number $GITHUB_PR_NUMBER \
92 --start-rev $(git merge-base $START_REV $END_REV) \
93 --end-rev $END_REV \
94 --changed-files "$CHANGED_FILES"
96 - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
99 name: workflow-args