Skip to content

Commit

Permalink
Enable parallelism (#213)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
jnooree and 2bndy5 authored Mar 28, 2024
1 parent 0061cab commit 065b5ba
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/self-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ on:
- 'requirements.txt'
- 'docs/examples/demo/**'
- '.github/workflows/self-test.yml'
pull_request_target:
branches: main
paths:
- 'action.yml'
- 'requirements.txt'
- 'docs/examples/demo/**'
- '.github/workflows/self-test.yml'

jobs:
test:
Expand Down
13 changes: 11 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ inputs:
> The [`no-lgtm`](#no-lgtm) option is applicable to Pull Request reviews.
required: false
default: false
jobs:
description: |
The number of jobs to run in parallel.
If less than or equal to 0, the number of jobs is set to
use the number of all available CPU cores.
required: false
default: 0
outputs:
checks-failed:
description: An integer that can be used as a boolean value to indicate if any checks failed by clang-tidy and clang-format.
Expand Down Expand Up @@ -260,7 +267,8 @@ runs:
--file-annotations=${{ inputs.file-annotations }} \
--extra-arg="${{ inputs.extra-args }}" \
--tidy-review="${{ inputs.tidy-review }}" \
--format-review="${{ inputs.format-review }}"
--format-review="${{ inputs.format-review }}" \
--jobs=${{ inputs.jobs }}
- name: Setup python venv (Windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -295,6 +303,7 @@ runs:
' --file-annotations=${{ inputs.file-annotations }}' +
' --extra-arg="${{ inputs.extra-args }}"' +
' --tidy-review="${{ inputs.tidy-review }}"' +
' --format-review="${{ inputs.format-review }}"'
' --format-review="${{ inputs.format-review }}"' +
' --jobs=${{ inputs.jobs }}'
Invoke-Expression -Command $app
2 changes: 2 additions & 0 deletions docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ inputs:
format-review:
minimum-version: '2.9.0'
required-permission: 'pull-requests: write #pull-request-reviews'
jobs:
minimum-version: '2.11.0'
outputs:
checks-failed:
minimum-version: '1.2.0'
Expand Down

1 comment on commit 065b5ba

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format reports: 2 file(s) not formatted
  • docs/examples/demo/demo.cpp
  • docs/examples/demo/demo.hpp
clang-tidy reports: 7 concern(s)

Have any feedback or feature suggestions? Share it here.

Please sign in to comment.