Skip to content

Commit a40cd3b

Browse files
committed
Change CI to use bazel target
1 parent 1f477de commit a40cd3b

1 file changed

Lines changed: 5 additions & 26 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,18 @@ jobs:
1515
with:
1616
python-version: "3.10"
1717

18+
- name: Setup Bazel
19+
uses: bazel-contrib/setup-bazel@0.15.0
20+
1821
- name: Install dependencies
1922
run: |
2023
python -m pip install --upgrade pip
2124
pip install pylint
22-
source dependency/buildifier.sh
23-
echo "$(dirname $BUILDIFIER_EXE)" >> $GITHUB_PATH
2425
2526
- name: Analysing the code with pylint
26-
run: |
27-
pylint .
27+
run: pylint .
2828

2929
- name: Analyzing the code with Buildifier
30-
run: |
31-
set +e
32-
BUILDIFIER_FORMAT=$(buildifier -diff_command="diff -u" -d -r . 2>&1)
33-
FORMAT_EXIT_CODE=$?
34-
BUILDIFIER_LINT=$(buildifier --lint=warn -r . 2>&1)
35-
LINT_EXIT_CODE=$?
36-
set -e
37-
echo "$BUILDIFIER_FORMAT"
38-
echo "$BUILDIFIER_LINT"
39-
echo "### Buildifier Format Issues" >> $GITHUB_STEP_SUMMARY
40-
echo '```diff' >> $GITHUB_STEP_SUMMARY
41-
echo "$BUILDIFIER_FORMAT" >> $GITHUB_STEP_SUMMARY
42-
ech '```' >> $GITHUB_STEP_SUMMARY
43-
echo "### Buildifier Linter Issues" >> $GITHUB_STEP_SUMMARY
44-
echo '```diff' >> $GITHUB_STEP_SUMMARY
45-
echo "$BUILDIFIER_LINT" >> $GITHUB_STEP_SUMMARY
46-
eho '```' >> $GITHUB_STEP_SUMMARY
47-
if [ $FORMAT_EXIT_CODE -ne 0 ]; then
48-
exit $FORMAT_EXIT_CODE
49-
else
50-
exit $LINT_EXIT_CODE
51-
fi
30+
run: bazel test //:buildifier
5231

5332
# TODO: Add more linters here

0 commit comments

Comments
 (0)