-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[Github] Make pr-code-format.yml use ci-*-format container #163044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Github] Make pr-code-format.yml use ci-*-format container #163044
Conversation
|
@llvm/pr-subscribers-infrastructure @llvm/pr-subscribers-github-workflow Author: Aiden Grossman (boomanaiden154) ChangesThis allows us to not spend 60-90s per job installing all of the tools as they are prebuilt into the container. Full diff: https://github.com/llvm/llvm-project/pull/163044.diff 1 Files Affected:
diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 1e0dc7045c1cc..106898e502366 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -12,6 +12,8 @@ on:
jobs:
code_formatter:
runs-on: ubuntu-24.04
+ container:
+ image: 'ghcr.io/llvm/ci-ubuntu-24.04-format'
timeout-minutes: 30
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
@@ -23,6 +25,12 @@ jobs:
with:
fetch-depth: 2
+ # We need to set the repo checkout as safe, otherwise tj-actions/changed-files
+ # will fail due to the changed ownership inside the container.
+ - name: Set Safe Directory
+ run: |
+ git config --global --add safe.directory $(pwd)
+
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
@@ -39,24 +47,6 @@ jobs:
echo "Formatting files:"
echo "$CHANGED_FILES"
- # The clang format version should always be upgraded to the first version
- # of a release cycle (x.1.0) or the last version of a release cycle, or
- # if there have been relevant clang-format backports.
- - name: Install clang-format
- uses: aminya/setup-cpp@a276e6e3d1db9160db5edc458e99a30d3b109949 # v1.7.1
- with:
- clangformat: 21.1.0
-
- - name: Setup Python env
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
- with:
- python-version: '3.13'
- cache: 'pip'
- cache-dependency-path: 'llvm/utils/git/requirements_formatting.txt'
-
- - name: Install python dependencies
- run: pip install -r llvm/utils/git/requirements_formatting.txt
-
- name: Run code formatter
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
Did you have a successful test-run? |
I thought I tested this one, looks like I just misremembered and only tested my other PR. |
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
This reverts commit 4432b66.
|
✅ With the latest revision this PR passed the Python code formatter. |
This reverts commit 227a95c.
Works now. |
vbvictor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This allows us to not spend 60-90s per job installing all of the tools as they are prebuilt into the container.
This allows us to not spend 60-90s per job installing all of the tools as they are prebuilt into the container.