A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 16, 10:45 UTC
[CI/Build] Add linting for github actions workflows (#7876)
Signed-off-by: Russell Bryant <rbryant@redhat.com>
Russell Bryant committed
Oct 7, 2024 at 17:18 UTC
e0dbdb013dfe5cdbe044317b4d7d55644d6399b3
11 files changed
+87
-14
.github/workflows/actionlint.yml
new
+37
@@ -0,0 +1,37 @@
1
+name: Lint GitHub Actions workflows
2
+on:
3
+ push:
4
+ branches:
5
+ - "main"
6
+ paths:
7
+ - '.github/workflows/*.ya?ml'
8
+ - '.github/workflows/actionlint.*'
9
+ pull_request:
10
+ branches:
11
+ - "main"
12
+ paths:
13
+ - '.github/workflows/*.ya?ml'
14
+ - '.github/workflows/actionlint.*'
15
+
16
+env:
17
+ LC_ALL: en_US.UTF-8
18
+
19
+defaults:
20
+ run:
21
+ shell: bash
22
+
23
+permissions:
24
+ contents: read
25
+
26
+jobs:
27
+ actionlint:
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - name: "Checkout"
31
+ uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
32
+ with:
33
+ fetch-depth: 0
34
+
35
+ - name: "Run actionlint"
36
+ run: |
37
+ tools/actionlint.sh -color
.github/workflows/add_label_automerge.yml
+1
-1
@@ -8,7 +8,7 @@ jobs:
8
runs-on: ubuntu-latest
9
steps:
10
- name: Add label
11
- uses: actions/github-script@v5
11
+ uses: actions/github-script@v6
12
with:
13
script: |
14
github.rest.issues.addLabels({
.github/workflows/clang-format.yml
+2
-2
@@ -17,9 +17,9 @@ jobs:
17
matrix:
18
python-version: ["3.11"]
19
steps:
20
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v3
21
- name: Set up Python ${{ matrix.python-version }}
22
- uses: actions/setup-python@v2
22
+ uses: actions/setup-python@v3
23
with:
24
python-version: ${{ matrix.python-version }}
25
- name: Install dependencies
.github/workflows/matchers/actionlint.json
new
+17
@@ -0,0 +1,17 @@
1
+{
2
+ "problemMatcher": [
3
+ {
4
+ "owner": "actionlint",
5
+ "pattern": [
6
+ {
7
+ "regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
8
+ "file": 1,
9
+ "line": 2,
10
+ "column": 3,
11
+ "message": 4,
12
+ "code": 5
13
+ }
14
+ ]
15
+ }
16
+ ]
17
+}
.github/workflows/mypy.yaml
+2
-2
@@ -17,9 +17,9 @@ jobs:
17
matrix:
18
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19
steps:
20
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v3
21
- name: Set up Python ${{ matrix.python-version }}
22
- uses: actions/setup-python@v2
22
+ uses: actions/setup-python@v3
23
with:
24
python-version: ${{ matrix.python-version }}
25
- name: Install dependencies
.github/workflows/publish.yml
+4
-4
@@ -26,7 +26,7 @@ jobs:
26
- name: Extract branch info
27
shell: bash
28
run: |
29
- echo "release_tag=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
29
+ echo "release_tag=${GITHUB_REF#refs/*/}" >> "$GITHUB_ENV"
30
31
- name: Create Release
32
id: create_release
@@ -86,10 +86,10 @@ jobs:
86
CMAKE_BUILD_TYPE: Release # do not compile with debug symbol to reduce wheel size
87
run: |
88
bash -x .github/workflows/scripts/build.sh ${{ matrix.python-version }} ${{ matrix.cuda-version }}
89
- wheel_name=$(ls dist/*whl | xargs -n 1 basename)
89
+ wheel_name=$(find dist -name "*whl" -print0 | xargs -0 -n 1 basename)
90
asset_name=${wheel_name//"linux"/"manylinux1"}
91
- echo "wheel_name=${wheel_name}" >> $GITHUB_ENV
92
- echo "asset_name=${asset_name}" >> $GITHUB_ENV
91
+ echo "wheel_name=${wheel_name}" >> "$GITHUB_ENV"
92
+ echo "asset_name=${asset_name}" >> "$GITHUB_ENV"
93
94
- name: Upload Release Asset
95
uses: actions/upload-release-asset@v1
.github/workflows/ruff.yml
+2
-2
@@ -17,9 +17,9 @@ jobs:
17
matrix:
18
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
19
steps:
20
- - uses: actions/checkout@v2
20
+ - uses: actions/checkout@v3
21
- name: Set up Python ${{ matrix.python-version }}
22
- uses: actions/setup-python@v2
22
+ uses: actions/setup-python@v3
23
with:
24
python-version: ${{ matrix.python-version }}
25
- name: Install dependencies
.github/workflows/yapf.yml
+2
-2
@@ -16,9 +16,9 @@ jobs:
16
matrix:
17
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
18
steps:
19
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v3
20
- name: Set up Python ${{ matrix.python-version }}
21
- uses: actions/setup-python@v2
21
+ uses: actions/setup-python@v3
22
with:
23
python-version: ${{ matrix.python-version }}
24
- name: Install dependencies
.gitignore
+3
@@ -199,3 +199,6 @@ hip_compat.h
199
200
# Benchmark dataset
201
benchmarks/*.json
202
+
203
+# Linting
204
+actionlint
format.sh
+4
-1
@@ -263,7 +263,7 @@ clang_format_changed() {
263
MERGEBASE="$(git merge-base origin/main HEAD)"
264
265
# Get the list of changed files, excluding the specified ones
266
- changed_files=$(git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.h' '*.cpp' '*.cu' '*.cuh' | grep -vFf <(printf "%s\n" "${CLANG_FORMAT_EXCLUDES[@]}"))
266
+ changed_files=$(git diff --name-only --diff-filter=ACM "$MERGEBASE" -- '*.h' '*.cpp' '*.cu' '*.cuh' | (grep -vFf <(printf "%s\n" "${CLANG_FORMAT_EXCLUDES[@]}") || echo -e))
267
if [ -n "$changed_files" ]; then
268
echo "$changed_files" | xargs -P 5 clang-format -i
269
fi
@@ -286,6 +286,9 @@ else
286
fi
287
echo 'vLLM clang-format: Done'
288
289
+echo 'vLLM actionlint:'
290
+tools/actionlint.sh -color
291
+echo 'vLLM actionlint: Done'
292
293
if ! git diff --quiet &>/dev/null; then
294
echo 'Reformatted files. Please review and stage the changes.'
tools/actionlint.sh
new
+13
@@ -0,0 +1,13 @@
1
+#!/bin/bash
2
+
3
+if command -v actionlint &> /dev/null; then
4
+ actionlint "$@"
5
+ exit 0
6
+elif [ -x ./actionlint ]; then
7
+ ./actionlint "$@"
8
+ exit 0
9
+fi
10
+
11
+# download a binary to the current directory - v1.7.3
12
+bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/aa0a7be8e566b096e64a5df8ff290ec24fa58fbc/scripts/download-actionlint.bash)
13
+./actionlint "$@"