Skip to content

Commit

Permalink
format.sh: lint github ci configuration
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
russellb committed Sep 4, 2024
1 parent 15b35bd commit 17af6a0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,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.'
Expand Down

0 comments on commit 17af6a0

Please sign in to comment.