15
runs-on: ubuntu-latest
16
outputs:
17
actionlint: ${{ steps.actionlint.outputs.run }}
18
- clangformat: ${{ steps.clangformat.outputs.run }}
18
+ # clangformat: ${{ steps.clangformat.outputs.run }}
19
flake8: ${{ steps.flake8.outputs.run }}
20
golangci-lint: ${{ steps.golangci-lint.outputs.run }}
21
hadolint: ${{ steps.hadolint.outputs.run }}
65
run: |
66
if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/golangci-lint') }}" = "true" ]; then
67
echo "run=true" >> "${GITHUB_OUTPUT}"
68
- elif git diff --name-only origin/${{ github.base_ref }} HEAD -- | grep -Eq '.*\.go' ; then
69
- echo "run=true" >> $GITHUB_OUTPUT
68
+ elif git diff --name-only origin/"${{ github.base_ref }}" HEAD -- | grep -Eq '.*\.go'; then
69
+ echo "run=true" >> "${GITHUB_OUTPUT}"
70
echo 'Go code has changed, need to run golangci-lint.'
71
else
72
- echo "run=false" >> $GITHUB_OUTPUT
72
+ echo "run=false" >> "${GITHUB_OUTPUT}"
73
fi
74
- name: Check files for hadolint
75
id: hadolint
122
github_token: ${{ secrets.GITHUB_TOKEN }}
123
reporter: github-pr-check
124
125
- clang-format:
126
- name: clang-format
127
- needs: prep-review
128
- if: needs.prep-review.outputs.clangformat == 'true'
129
- runs-on: ubuntu-latest
130
- steps:
131
- - name: Git clone repository
132
- uses: actions/checkout@v4
133
- with:
134
- submodules: false
135
- fetch-depth: 0
136
- - name: Check for label
137
- id: label
138
- run: |
139
- if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/clang-format') }}" = "true" ]; then
140
- echo 'check-all=true' >> "${GITHUB_OUTPUT}"
141
- else
142
- echo 'check-all=false' >> "${GITHUB_OUTPUT}"
143
- fi
144
- - name: Run clang-format
145
- run: |
146
- if [ "${{ steps.label.outputs.check-all }}" == 'true' ]; then
147
- find . -regex '.*\.\(c\|cpp\|cxx\|h\|hpp\|hxx\)$' -exec clang-format -i --style=file '{}' \;
148
- else
149
- git diff --name-only origin/${{ github.base_ref }} HEAD | grep -E '\.cpp$|\.cxx$|\.c$|\.hpp$|\.hxx$|\.h$' | \
150
- xargs -n 1 -r clang-format -i --style=file
151
- fi
152
- git status --porcelain=v1 > /tmp/porcelain
153
- if [ -s /tmp/porcelain ]; then
154
- cat /tmp/porcelain
155
- exit 1
156
- fi
125
+# clang-format:
126
+# name: clang-format
127
+# needs: prep-review
128
+# if: needs.prep-review.outputs.clangformat == 'true'
129
+# runs-on: ubuntu-latest
130
+# steps:
131
+# - name: Git clone repository
132
+# uses: actions/checkout@v4
133
+# with:
134
+# submodules: false
135
+# fetch-depth: 0
136
+# - name: Check for label
137
+# id: label
138
+# run: |
139
+# if [ "${{ contains(github.event.pull_request.labels.*.name, 'run-ci/clang-format') }}" = "true" ]; then
140
+# echo 'check-all=true' >> "${GITHUB_OUTPUT}"
141
+# else
142
+# echo 'check-all=false' >> "${GITHUB_OUTPUT}"
143
+# fi
144
+# - name: Run clang-format
145
+# run: |
146
+# if [ "${{ steps.label.outputs.check-all }}" == 'true' ]; then
147
+# find . -regex '.*\.\(c\|cpp\|cxx\|h\|hpp\|hxx\)$' -exec clang-format -i --style=file '{}' \;
148
+# else
149
+# git diff --name-only origin/${{ github.base_ref }} HEAD | grep -E '\.cpp$|\.cxx$|\.c$|\.hpp$|\.hxx$|\.h$' | \
150
+# xargs -n 1 -r clang-format -i --style=file
151
+# fi
152
+# git status --porcelain=v1 > /tmp/porcelain
153
+# if [ -s /tmp/porcelain ]; then
154
+# cat /tmp/porcelain
155
+# exit 1
156
+# fi
157
158
flake8:
159
name: flake8