-
Notifications
You must be signed in to change notification settings - Fork 12k
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
[libc++] Move the check-generated-files job to Github Actions #68920
Conversation
@llvm/pr-subscribers-github-workflow @llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesThis allows running these quick checks faster than in our Buildkite pipeline, which has much more latency. This will also avoid blocking the rest of the testing pipeline in case the generated-files checks are failing. Full diff: https://github.com/llvm/llvm-project/pull/68920.diff 2 Files Affected:
diff --git a/.github/workflows/libcxx-check-generated-files.yml b/.github/workflows/libcxx-check-generated-files.yml
new file mode 100644
index 000000000000000..609065c1e1c38aa
--- /dev/null
+++ b/.github/workflows/libcxx-check-generated-files.yml
@@ -0,0 +1,29 @@
+name: "Check libc++ generated files"
+on:
+ pull_request_target:
+ paths:
+ - 'libcxx/**'
+permissions:
+ pull-requests: write
+
+jobs:
+ check_generated_files:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Fetch LLVM sources
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 2
+
+ - name: Install clang-format
+ uses: aminya/setup-cpp@v1
+ with:
+ clangformat: 17.0.1
+
+ - name: Install Ninja
+ uses: seanmiddleditch/gha-setup-ninja@master
+ with:
+ destination: build/ninja-install
+
+ - name: Check generated files
+ run: libcxx/utils/ci/run-buildbot check-generated-output
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index ebfb35eee91e1ed..8866a33d04d5a2d 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -33,24 +33,6 @@ steps:
#
# Light pre-commit tests for things like forgetting to update generated files.
#
- - label: "Generated output"
- command: "libcxx/utils/ci/run-buildbot check-generated-output"
- artifact_paths:
- - "**/generated_output.patch"
- - "**/generated_output.status"
- env:
- CC: "clang-${LLVM_HEAD_VERSION}"
- CXX: "clang++-${LLVM_HEAD_VERSION}"
- CLANG_FORMAT: "/usr/bin/clang-format-${LLVM_STABLE_VERSION}"
- agents:
- queue: "libcxx-builders"
- os: "linux"
- retry:
- automatic:
- - exit_status: -1 # Agent was lost
- limit: 2
- timeout_in_minutes: 120
-
- label: "Documentation"
command: "libcxx/utils/ci/run-buildbot documentation"
artifact_paths:
|
Can we just use & fix the existing formatting check? |
As I explained on Discord:
This patch tries to incrementally fix issues with (2) |
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.
I would like a response to the comment about security, but otherwise LGTM.
clangformat: 17.0.1 | ||
|
||
- name: Install Ninja | ||
uses: seanmiddleditch/gha-setup-ninja@master |
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.
Are we using these actions elsewhere? Because using random actions associated with the project might be a security risk?
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.
We could specify a different container and skip a lot of these steps, no?
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.
We have our own action for installing ninja: llvm/actions/install-ninja
But do we really need this if the job is always going to run on Linux? Can we just apt install it?
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.
Is it more idiomatic to use llvm/actions/install-ninja or to install it manually? I don't really mind either way. I think I've seen uses:
being used more often in actions but I don't mind using apt-get
directly either.
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.
If we build a container and run the job in that container, we'll save time each iteration of the job, no?
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.
Yes, I do want to investigate setting up a container for libc++ jobs and storing that in the GH Docker registry to gradually replace our current DockerHub thing, but I would like to tackle that as a separate task to improve the CI situation in the short term.
This updates the clang-format we use in libc++ to 17. This is necessary to start running the generated-files checks in GitHub Actions (in llvm#68920). In fact this is a pre-existing issue regardless of llvm#68920 -- right now our ignore_format.txt job disagrees with the LLVM-wide clang-format job.
c167ea6
to
8667396
Compare
8667396
to
24f81ee
Compare
This allows running these quick checks faster than in our Buildkite pipeline, which has much more latency. This will also avoid blocking the rest of the testing pipeline in case the generated-files checks are failing.
24f81ee
to
d1c371b
Compare
Sorry for the churn on the patch -- AFAICT this should be ready to review again now. I'm using |
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.
Looks good with some suggestions.
This allows running these quick checks faster than in our Buildkite pipeline, which has much more latency. This will also avoid blocking the rest of the testing pipeline in case the generated-files checks are failing.