Skip to content

Commit 065b5ba

Browse files
jnooree2bndy5
andauthored
Enable parallelism (#213)
* feat: add --jobs parameter to action See cpp-linter/cpp-linter#92 for the related CLI updates. * adjustments for docs --------- Co-authored-by: Brendan <[email protected]>
1 parent 0061cab commit 065b5ba

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

Diff for: .github/workflows/self-test.yml

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ on:
1515
- 'requirements.txt'
1616
- 'docs/examples/demo/**'
1717
- '.github/workflows/self-test.yml'
18+
pull_request_target:
19+
branches: main
20+
paths:
21+
- 'action.yml'
22+
- 'requirements.txt'
23+
- 'docs/examples/demo/**'
24+
- '.github/workflows/self-test.yml'
1825

1926
jobs:
2027
test:

Diff for: action.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ inputs:
191191
> The [`no-lgtm`](#no-lgtm) option is applicable to Pull Request reviews.
192192
required: false
193193
default: false
194+
jobs:
195+
description: |
196+
The number of jobs to run in parallel.
197+
If less than or equal to 0, the number of jobs is set to
198+
use the number of all available CPU cores.
199+
required: false
200+
default: 0
194201
outputs:
195202
checks-failed:
196203
description: An integer that can be used as a boolean value to indicate if any checks failed by clang-tidy and clang-format.
@@ -260,7 +267,8 @@ runs:
260267
--file-annotations=${{ inputs.file-annotations }} \
261268
--extra-arg="${{ inputs.extra-args }}" \
262269
--tidy-review="${{ inputs.tidy-review }}" \
263-
--format-review="${{ inputs.format-review }}"
270+
--format-review="${{ inputs.format-review }}" \
271+
--jobs=${{ inputs.jobs }}
264272
265273
- name: Setup python venv (Windows)
266274
if: runner.os == 'Windows'
@@ -295,6 +303,7 @@ runs:
295303
' --file-annotations=${{ inputs.file-annotations }}' +
296304
' --extra-arg="${{ inputs.extra-args }}"' +
297305
' --tidy-review="${{ inputs.tidy-review }}"' +
298-
' --format-review="${{ inputs.format-review }}"'
306+
' --format-review="${{ inputs.format-review }}"' +
307+
' --jobs=${{ inputs.jobs }}'
299308
300309
Invoke-Expression -Command $app

Diff for: docs/action.yml

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ inputs:
4040
format-review:
4141
minimum-version: '2.9.0'
4242
required-permission: 'pull-requests: write #pull-request-reviews'
43+
jobs:
44+
minimum-version: '2.11.0'
4345
outputs:
4446
checks-failed:
4547
minimum-version: '1.2.0'

0 commit comments

Comments
 (0)