-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[CI/Build] Add linting for github actions workflows #7876
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge). To run full CI, you can do one of these:
🚀 |
/ready |
Thanks @russellb! I wonder if we could incorporate this into the existing |
Sure, thanks for the tip. Integrating wherever it's most natural for existing dev workflows is best! I'll modify for using |
5c5d1a3
to
276b408
Compare
format.sh
Outdated
fi | ||
# Ensure we use the same version of actionlint as CI | ||
IMAGE="vllm/actionlint:latest" | ||
${DOCKER} build --tag "${IMAGE}" - < .github/workflows/actionlint.dockerfile |
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.
Can we use something like flake8
instead of Docker for local formatting? Some people might not have Docker installed ...
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.
It will at least skip this step gracefully if it's not installed.
The alternative is that go
needs to be installed. It's not a Python tool. https://github.com/rhysd/actionlint
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.
They have pre-built binaries, so I could have it auto-download that. I'll look at that now.
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.
@khluu I've got it using a prebuilt binary from a github release if it's not found, so there are no longer any dependencies for this to work
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.
Thanks!
Add a new github actions workflow that will perform linting on github actions workflow changes. It will only run if github workflows are modified. Signed-off-by: Russell Bryant <rbryant@redhat.com>
Avoid accidental globbing or argument splitting by quoting the `$GITHUB_ENV` variable. In practice, this would probably never be a problem since github sets the value, but it follows best shell practices and makes the shell linter happy. Signed-off-by: Russell Bryant <rbryant@redhat.com>
Resolve the following linter warning: ``` .github/workflows/publish.yml:87:9: shellcheck reported issue in this script: SC2011:warning:2:14: Use 'find .. -print0 | xargs -0 ..' or 'find .. -exec .. +' to allow non-alphanumeric filenames [shellcheck] ``` I don't expect this was a problem in practice, but it follows best practice as indicated by the linter. Signed-off-by: Russell Bryant <rbryant@redhat.com>
These were raised by the action linter. Signed-off-by: Russell Bryant <rbryant@redhat.com>
This script is set to exit any time a command fails. In the case of this line, the script unexpectedly errors out on this check to see if any files have changed that are relevant for the `clang-format` tool. The `grep` specifically will return non-zero in this case. The workaround here is to catch the error and run `echo -e` instead, which we know will succeed and the end result is what we want (the list of changed files will be empty). This allows the script to continue to completion, even when `clang-format` has nothing to do. Signed-off-by: Russell Bryant <rbryant@redhat.com>
Update `format.sh` to run the `actionlint` tool to check for errors in GitHub CI configuration. Both this script and the workflow to run this tool in CI run it using docker to ensure that the same version is in use in both places. Signed-off-by: Russell Bryant <rbryant@redhat.com>
Previously `format.sh` and the github workflow used docker or podman to run actionlint. This now will use an installed version if found, and will otherwise download and run a prebuilt binary from a github release. Signed-off-by: Russell Bryant <rbryant@redhat.com>
This PR introduces linting for github actions workflows to help prevent any
accidental introduction of errors in the future. It introduces this linting in
two ways:
A way to run the linting locally as part of
format.sh
.Automatically run the linter in CI anytime github actions workflows are
modified.
71be98b github: Add an actionlint github workflow
a9785b5 github: Quote variables
2dcdd71 github: Handle filenames with special characters
fc050dd github: Update versions of various github actions
0956a41 format.sh: Avoid exit when no files changed
276b408 format.sh: lint github ci configuration
commit 71be98b
Author: Russell Bryant rbryant@redhat.com
Date: Mon Aug 26 13:39:01 2024 -0400
commit a9785b5
Author: Russell Bryant rbryant@redhat.com
Date: Mon Aug 26 13:30:03 2024 -0400
commit 2dcdd71
Author: Russell Bryant rbryant@redhat.com
Date: Mon Aug 26 13:34:03 2024 -0400
commit fc050dd
Author: Russell Bryant rbryant@redhat.com
Date: Mon Aug 26 14:27:30 2024 -0400
commit 0956a41
Author: Russell Bryant rbryant@redhat.com
Date: Tue Aug 27 10:08:31 2024 -0400
commit 276b408
Author: Russell Bryant rbryant@redhat.com
Date: Tue Aug 27 11:08:50 2024 -0400