From 276b4088688f13d311f1807de634e20165c35166 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Tue, 27 Aug 2024 11:08:50 -0400 Subject: [PATCH] format.sh: lint github ci configuration 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 --- format.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/format.sh b/format.sh index 39a44cf2a59c6..78dd2a81c1080 100755 --- a/format.sh +++ b/format.sh @@ -287,6 +287,29 @@ else fi echo 'vLLM clang-format: Done' +echo 'vLLM actionlint:' + +DOCKER="" +if command -v "docker" &>/dev/null; then + DOCKER="docker" +elif command -v "podman" &>/dev/null; then + DOCKER="podman" +else + echo "Docker or Podman are not installed. Please install one if you want to lint GitHub CI configuration." +fi + +actionlint() { + if [ -z "$DOCKER" ]; then + return + fi + # Ensure we use the same version of actionlint as CI + IMAGE="vllm/actionlint:latest" + ${DOCKER} build --tag "${IMAGE}" - < .github/workflows/actionlint.dockerfile + ${DOCKER} run --volume="${PWD}:/repo:z" --workdir=/repo "${IMAGE}" -color +} + +actionlint +echo 'vLLM actionlint: Done' if ! git diff --quiet &>/dev/null; then echo 'Reformatted files. Please review and stage the changes.'