@@ -219,13 +219,13 @@ inputs:
219
219
outputs :
220
220
checks-failed :
221
221
description : An integer that can be used as a boolean value to indicate if any checks failed by clang-tidy and clang-format.
222
- value : ${{ steps.cpp-linter-unix.outputs.checks-failed || steps.cpp-linter-windows .outputs.checks-failed }}
222
+ value : ${{ steps.cpp-linter.outputs.checks-failed }}
223
223
clang-tidy-checks-failed :
224
224
description : An integer that can be used as a boolean value to indicate if any checks failed by clang-tidy only.
225
- value : ${{ steps.cpp-linter-unix.outputs.clang-tidy-checks-failed || steps.cpp-linter-windows .outputs.clang-tidy-checks-failed }}
225
+ value : ${{ steps.cpp-linter.outputs.clang-tidy-checks-failed }}
226
226
clang-format-checks-failed :
227
227
description : An integer that can be used as a boolean value to indicate if any checks failed by clang-format only.
228
- value : ${{ steps.cpp-linter-unix.outputs.clang-format-checks-failed || steps.cpp-linter-windows .outputs.clang-format-checks-failed }}
228
+ value : ${{ steps.cpp-linter.outputs.clang-format-checks-failed }}
229
229
runs :
230
230
using : " composite"
231
231
steps :
@@ -237,9 +237,9 @@ runs:
237
237
# First try installing from default Ubuntu repositories before trying LLVM script
238
238
if ! sudo apt-get install -y clang-format-${{ inputs.version }} clang-tidy-${{ inputs.version }}; then
239
239
# This LLVM script will add the relevant LLVM PPA: https://apt.llvm.org/
240
- wget https://apt.llvm.org/llvm.sh -O $GITHUB_ACTION_PATH/llvm_install.sh
241
- chmod +x $GITHUB_ACTION_PATH/llvm_install.sh
242
- if sudo $GITHUB_ACTION_PATH/llvm_install.sh ${{ inputs.version }}; then
240
+ wget https://apt.llvm.org/llvm.sh -O ${ GITHUB_ACTION_PATH%/} /llvm_install.sh
241
+ chmod +x ${ GITHUB_ACTION_PATH%/} /llvm_install.sh
242
+ if sudo ${ GITHUB_ACTION_PATH%/} /llvm_install.sh ${{ inputs.version }}; then
243
243
sudo apt-get install -y clang-format-${{ inputs.version }} clang-tidy-${{ inputs.version }}
244
244
fi
245
245
fi
@@ -253,89 +253,63 @@ runs:
253
253
ln -s "$(brew --prefix llvm@${{ inputs.version }})/bin/clang-format" "/usr/local/bin/clang-format-${{ inputs.version }}"
254
254
ln -s "$(brew --prefix llvm@${{ inputs.version }})/bin/clang-tidy" "/usr/local/bin/clang-tidy-${{ inputs.version }}"
255
255
256
- - name : Setup cpp-linter dependencies (Unix)
257
- if : runner.os == 'Linux' || runner.os == 'macOS'
258
- shell : bash
259
- env :
260
- UV_NO_MODIFY_PATH : 1
261
- UV_PROJECT_ENVIRONMENT : ${{ github.action_path }}
262
- UV_INSTALL_DIR : ${{ github.action_path }}/bin
263
- run : |
264
- curl -LsSf https://astral.sh/uv/install.sh | sh
265
- ${{ env.UV_INSTALL_DIR }}/uv sync --config-file "${{ env.GITHUB_ACTION_PATH }}" --group action
266
- ${{ env.UV_INSTALL_DIR }}/uv run clang-tools -i ${{ inputs.version }} -b
256
+ - name : Setup nu shell
257
+ uses : hustcer/setup-nu@v3
258
+ with :
259
+ version : ' 0.106.1'
267
260
268
- - name : Setup cpp-linter dependencies (Windows)
269
- if : runner.os == 'Windows'
270
- shell : pwsh
261
+ - name : Setup cpp-linter dependencies
262
+ shell : nu {0}
271
263
env :
272
264
UV_NO_MODIFY_PATH : 1
273
- UV_INSTALL_DIR : ${{ github.action_path }}/bin
274
- UV_PROJECT_ENVIRONMENT : ${{ github.action_path }}
275
- run : |
276
- powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/0.8.9/install.ps1 | iex"
277
- ${{ env.UV_INSTALL_DIR }}/uv sync --config-file "${{ env.GITHUB_ACTION_PATH }}" --group action
278
- ${{ env.UV_INSTALL_DIR }}/uv run clang-tools -i ${{ inputs.version }} -b
265
+ run : |-
266
+ let action_path = $env.GITHUB_ACTION_PATH | str trim --right --char '/'
267
+ $env.UV_INSTALL_DIR = $action_path | path join 'bin'
268
+ $env.UV_PROJECT_ENVIRONMENT = $action_path | path join '.venv'
269
+ let project_toml = $action_path | path join 'pyproject.toml'
279
270
280
- - name : Run cpp-linter (Unix)
281
- if : runner.os == 'Linux' || runner.os == 'macOS'
282
- id : cpp-linter-unix
283
- shell : bash
284
- env :
285
- UV_PROJECT_ENVIRONMENT : ${{ github.action_path }}
286
- UV_INSTALL_DIR : ${{ github.action_path }}/bin
287
- run : >-
288
- ${{ env.UV_INSTALL_DIR }}/uv run
289
- cpp-linter
290
- --style="${{ inputs.style }}"
291
- --extensions=${{ inputs.extensions }}
292
- --tidy-checks="${{ inputs.tidy-checks }}"
293
- --repo-root=${{ inputs.repo-root }}
294
- --version=${{ inputs.version }}
295
- --verbosity=${{ inputs.verbosity }}
296
- --lines-changed-only=${{ inputs.lines-changed-only }}
297
- --files-changed-only=${{ inputs.files-changed-only }}
298
- --thread-comments=${{ inputs.thread-comments }}
299
- --no-lgtm=${{ inputs.no-lgtm }}
300
- --step-summary=${{ inputs.step-summary }}
301
- --ignore="${{ inputs.ignore }}"
302
- --ignore-tidy="${{ inputs.ignore-tidy }}"
303
- --ignore-format="${{ inputs.ignore-format }}"
304
- --database=${{ inputs.database }}
305
- --file-annotations=${{ inputs.file-annotations }}
306
- --extra-arg="${{ inputs.extra-args }}"
307
- --tidy-review="${{ inputs.tidy-review }}"
308
- --format-review="${{ inputs.format-review }}"
309
- --passive-reviews="${{ inputs.passive-reviews }}"
310
- --jobs=${{ inputs.jobs }}
271
+ if ((sys host | get 'name') == 'Windows') {
272
+ ^powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/0.8.9/install.ps1 | iex"
273
+ } else {
274
+ ^curl -LsSf https://astral.sh/uv/install.sh | sh
275
+ }
311
276
312
- - name : Run cpp-linter (Windows)
313
- id : cpp-linter-windows
314
- shell : pwsh
315
- env :
316
- UV_PROJECT_ENVIRONMENT : ${{ github.action_path }}
317
- UV_INSTALL_DIR : ${{ github.action_path }}/bin
318
- run : >-
319
- ${{ env.UV_INSTALL_DIR }}/uv run
320
- cpp-linter
321
- --style="${{ inputs.style }}"
322
- --extensions=${{ inputs.extensions }}
323
- --tidy-checks="${{ inputs.tidy-checks }}"
324
- --repo-root=${{ inputs.repo-root }}
325
- --version=${{ inputs.version }}
326
- --verbosity=${{ inputs.verbosity }}
327
- --lines-changed-only=${{ inputs.lines-changed-only }}
328
- --files-changed-only=${{ inputs.files-changed-only }}
329
- --thread-comments=${{ inputs.thread-comments }}
330
- --no-lgtm=${{ inputs.no-lgtm }}
331
- --step-summary=${{ inputs.step-summary }}
332
- --ignore="${{ inputs.ignore }}"
333
- --ignore-tidy="${{ inputs.ignore-tidy }}"
334
- --ignore-format="${{ inputs.ignore-format }}"
335
- --database=${{ inputs.database }}
336
- --file-annotations=${{ inputs.file-annotations }}
337
- --extra-arg="${{ inputs.extra-args }}"
338
- --tidy-review="${{ inputs.tidy-review }}"
339
- --format-review="${{ inputs.format-review }}"
340
- --passive-reviews="${{ inputs.passive-reviews }}"
341
- --jobs=${{ inputs.jobs }}
277
+ ^$'($env.UV_INSTALL_DIR)/uv' sync --config-file $project_toml --group action
278
+ ^$'($env.UV_INSTALL_DIR)/uv' run clang-tools -i ${{ inputs.version }} -b
279
+
280
+ - name : Run cpp-linter
281
+ id : cpp-linter
282
+ shell : nu {0}
283
+ run : |-
284
+ let action_path = (
285
+ $env.GITHUB_ACTION_PATH
286
+ | str trim --right --char '/'
287
+ )
288
+ $env.UV_INSTALL_DIR = $action_path | path join 'bin'
289
+ $env.UV_PROJECT_ENVIRONMENT = $action_path | path join '.venv'
290
+
291
+ let args = [
292
+ --style="${{ inputs.style }}"
293
+ --extensions=${{ inputs.extensions }}
294
+ --tidy-checks="${{ inputs.tidy-checks }}"
295
+ --repo-root=${{ inputs.repo-root }}
296
+ --version=${{ inputs.version }}
297
+ --verbosity=${{ inputs.verbosity }}
298
+ --lines-changed-only=${{ inputs.lines-changed-only }}
299
+ --files-changed-only=${{ inputs.files-changed-only }}
300
+ --thread-comments=${{ inputs.thread-comments }}
301
+ --no-lgtm=${{ inputs.no-lgtm }}
302
+ --step-summary=${{ inputs.step-summary }}
303
+ --ignore="${{ inputs.ignore }}"
304
+ --ignore-tidy="${{ inputs.ignore-tidy }}"
305
+ --ignore-format="${{ inputs.ignore-format }}"
306
+ --database=${{ inputs.database }}
307
+ --file-annotations=${{ inputs.file-annotations }}
308
+ --extra-arg="${{ inputs.extra-args }}"
309
+ --tidy-review="${{ inputs.tidy-review }}"
310
+ --format-review="${{ inputs.format-review }}"
311
+ --passive-reviews="${{ inputs.passive-reviews }}"
312
+ --jobs=${{ inputs.jobs }}
313
+ ]
314
+
315
+ $'($env.UV_INSTALL_DIR)/uv' run cpp-linter ...$args
0 commit comments