From 0d1f984613ae95e7c3622c8d31ef260dbfb27379 Mon Sep 17 00:00:00 2001 From: Nuri Jung Date: Thu, 21 Mar 2024 14:46:27 +0900 Subject: [PATCH 1/3] feat: add --jobs parameter to action See cpp-linter/cpp-linter#92 for the related CLI updates. --- action.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index cdd9c15b..a5ada053 100644 --- a/action.yml +++ b/action.yml @@ -191,6 +191,11 @@ 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 <= 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. @@ -260,7 +265,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' @@ -295,6 +301,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 From 2b74cf406e8ca0b36338eb06e85085c510f4b5bf Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 27 Mar 2024 21:37:54 -0700 Subject: [PATCH 2/3] adjustments for docs --- action.yml | 4 +++- docs/action.yml | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index a5ada053..03dfff39 100644 --- a/action.yml +++ b/action.yml @@ -193,7 +193,9 @@ inputs: default: false jobs: description: | - The number of jobs to run in parallel. If <= 0, the number of jobs is set to use the number of all available CPU cores. + 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: diff --git a/docs/action.yml b/docs/action.yml index b5a5f232..40b65cd3 100644 --- a/docs/action.yml +++ b/docs/action.yml @@ -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' From 02f947426db77070da32fdc4cd32e4ba02619490 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 27 Mar 2024 22:24:06 -0700 Subject: [PATCH 3/3] try pull_request_target --- .github/workflows/self-test.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/self-test.yml b/.github/workflows/self-test.yml index c7700888..e2b1f54f 100644 --- a/.github/workflows/self-test.yml +++ b/.github/workflows/self-test.yml @@ -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: