Skip to content

Commit

Permalink
actionlint: Switch to prebuilt binary instead of docker
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
russellb committed Oct 7, 2024
1 parent cd2f73b commit 103f1dd
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 31 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/actionlint.dockerfile

This file was deleted.

9 changes: 2 additions & 7 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ jobs:
with:
fetch-depth: 0

- name: "Download actionlint"
- name: "Run actionlint"
run: |
docker build --tag actionlint - < .github/workflows/actionlint.dockerfile
- name: "Check workflow files"
run: |
echo "::add-matcher::.github/workflows/matchers/actionlint.json"
docker run --volume="${PWD}:/repo" --workdir=/repo actionlint -color
tools/actionlint.sh -color
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,6 @@ hip_compat.h

# Benchmark dataset
benchmarks/*.json

# Linting
actionlint
22 changes: 1 addition & 21 deletions format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -287,27 +287,7 @@ 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
tools/actionlint.sh -color
echo 'vLLM actionlint: Done'

if ! git diff --quiet &>/dev/null; then
Expand Down
13 changes: 13 additions & 0 deletions tools/actionlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if command -v actionlint &> /dev/null; then
actionlint "$@"
exit 0
elif [ -x ./actionlint ]; then
./actionlint "$@"
exit 0
fi

# download a binary to the current directory - v1.7.3
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/aa0a7be8e566b096e64a5df8ff290ec24fa58fbc/scripts/download-actionlint.bash)
./actionlint "$@"

0 comments on commit 103f1dd

Please sign in to comment.