Skip to content

Commit 967bbff

Browse files
authored
Add exitCode output property to run-cpptest-action, update dependencies
1 parent e415e0e commit 967bbff

14 files changed

Lines changed: 826 additions & 535 deletions

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
- run: |
1616
npm install
1717
- run: |

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
steps:
3737
- name: Checkout repository
38-
uses: actions/checkout@v4
38+
uses: actions/checkout@v6
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
test:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515
- run: |
1616
npm install
1717
- run: |

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Depending on the project type and the build system you are using (Make, CMake, e
4040
```yaml
4141
# Runs code analysis with C/C++test.
4242
- name: Run C/C++test
43-
uses: parasoft/run-cpptest-action@2.0.2
43+
uses: parasoft/run-cpptest-action@2
4444
with:
4545
input: build/compile_commands.json
4646
testConfig: 'builtin://MISRA C 2012'
@@ -68,7 +68,7 @@ To upload reports in other formats, modify your workflow by adding the `upload-
6868
# Uploads an archive that includes all report files (.xml, .html, .sarif).
6969
- name: Archive reports
7070
if: always()
71-
uses: actions/upload-artifact@v4
71+
uses: actions/upload-artifact@v7
7272
with:
7373
name: CpptestReports
7474
path: reports/*.*
@@ -115,7 +115,7 @@ jobs:
115115
116116
# Checks out your repository under $GITHUB_WORKSPACE, so that your job can access it.
117117
- name: Checkout code
118-
uses: actions/checkout@v4
118+
uses: actions/checkout@v6
119119
120120
# Configures your CMake project. Be sure the compile_commands.json file is created.
121121
- name: Configure project
@@ -128,7 +128,7 @@ jobs:
128128
# Runs code analysis with C/C++test.
129129
- name: Run C/C++test
130130
# Use the 'run-cpptest-action' GitHub action.
131-
uses: parasoft/run-cpptest-action@2.0.2
131+
uses: parasoft/run-cpptest-action@2
132132
# Optional parameters for 'run-cpptest-action'.
133133
with:
134134
# For CMake-based projects, use a compile_commands.json file as the input for analysis.
@@ -147,7 +147,7 @@ jobs:
147147
# Uploads an archive that includes all report files (.xml, .html, .sarif).
148148
- name: Archive reports
149149
if: always()
150-
uses: actions/upload-artifact@v4
150+
uses: actions/upload-artifact@v7
151151
with:
152152
name: CpptestReports
153153
path: reports/*.*
@@ -192,7 +192,7 @@ jobs:
192192
193193
# Checks out your repository under $GITHUB_WORKSPACE, so that your job can access it.
194194
- name: Checkout code
195-
uses: actions/checkout@v4
195+
uses: actions/checkout@v6
196196
197197
# Builds your Make project using 'cpptesttrace' to collect input data for code analysis.
198198
# Be sure 'cpptesttrace' is available on $PATH.
@@ -202,7 +202,7 @@ jobs:
202202
# Runs code analysis with C/C++test.
203203
- name: Run C/C++test
204204
# Use the 'run-cpptest-action' GitHub action.
205-
uses: parasoft/run-cpptest-action@2.0.2
205+
uses: parasoft/run-cpptest-action@2
206206
# Uncomment if you are using C/C++test 2020.2 to generate a SARIF report:
207207
# with:
208208
# reportFormat: xml,html,custom
@@ -218,7 +218,7 @@ jobs:
218218
# Uploads an archive that includes all report files (.xml, .html, .sarif).
219219
- name: Archive reports
220220
if: always()
221-
uses: actions/upload-artifact@v4
221+
uses: actions/upload-artifact@v7
222222
with:
223223
name: CpptestReports
224224
path: reports/*.*
@@ -237,7 +237,7 @@ If `cpptestcli` executable is not on `$PATH`, you can configure the path to the
237237

238238
```yaml
239239
- name: Run C/C++test
240-
uses: parasoft/run-cpptest-action@2.0.2
240+
uses: parasoft/run-cpptest-action@2
241241
with:
242242
installDir: '/opt/parasoft/cpptest'
243243
```
@@ -246,7 +246,7 @@ If `cpptestcli` executable is not on `$PATH`, you can configure the path to the
246246
You can configure the `input` parameter to provide the path to a file that defines the scope of analysis (includes a list of source files and compile commands). This parameter depends on the project type and the build system you are using. See the [C/C++test User Guide](https://docs.parasoft.com/display/CPPTEST20251/Running+Static+Analysis+1) for details.
247247
```yaml
248248
- name: Run C/C++test
249-
uses: parasoft/run-cpptest-action@2.0.2
249+
uses: parasoft/run-cpptest-action@2
250250
with:
251251
input: 'build/compile_commands.json'
252252
```
@@ -256,7 +256,7 @@ Code analysis with C/C++test is performed by using a test configuration - a set
256256
To specify a test configuration directly in your workflow, add the `testConfig` parameter to the `Run C/C++test` action and specify the URL of the test configuration you want to use:
257257
```yaml
258258
- name: Run C/C++test
259-
uses: parasoft/run-cpptest-action@2.0.2
259+
uses: parasoft/run-cpptest-action@2
260260
with:
261261
testConfig: 'builtin://MISRA C 2012'
262262
```
@@ -265,7 +265,7 @@ To specify a test configuration directly in your workflow, add the `testConfig`
265265
In order to run analysis, C/C++test needs to be configured for a specific compiler. You need to specify the configuration that matches your compiler with the `compilerConfig` parameter. See [Supported Compilers](https://docs.parasoft.com/display/CPPTEST20251/Supported+Compilers) for information about supported compilers.
266266
```yaml
267267
- name: Run C/C++test
268-
uses: parasoft/run-cpptest-action@2.0.2
268+
uses: parasoft/run-cpptest-action@2
269269
with:
270270
compilerConfig: 'clang_10_0'
271271
```
@@ -274,7 +274,7 @@ In order to run analysis, C/C++test needs to be configured for a specific compil
274274
Generating reports in the SARIF format is available in C/C++test since version 2021.1. If you are using an earlier C/C++test version, you need to customize the `Run C/C++test` action to enable generating SARIF reports:
275275
```yaml
276276
- name: Run C/C++test
277-
uses: parasoft/run-cpptest-action@2.0.2
277+
uses: parasoft/run-cpptest-action@2
278278
with:
279279
reportFormat: xml,html,custom
280280
additionalParams: '-property report.custom.extension=sarif -property report.custom.xsl.file=${PARASOFT_SARIF_XSL}'
@@ -321,7 +321,7 @@ This section describes how to customize the `Run C/C++test` action to run code a
321321
Use the `commandLinePattern` parameter to modify the command line for `cpptestcli` executable. The command line pattern depends on your project and the setup of the workspace. Example:
322322
```yaml
323323
- name: Run C/C++test
324-
uses: parasoft/run-cpptest-action@2.0.2
324+
uses: parasoft/run-cpptest-action@2
325325
with:
326326
# C/C++test workspace will be created in '../workspace'.
327327
# C/C++test will create a new project based on the provided .bdf file.
@@ -333,7 +333,7 @@ Note: The `compilerConfig` and `reportFormat` action parameters are not directly
333333
Create a `config.properties` file with additional configuration options for C/C++test Professional, such as reporting options, compiler configuration etc. Then pass the configuration file to `cpptestcli` with the `-localsettings config.properties` option:
334334
```yaml
335335
- name: Run C/C++test
336-
uses: parasoft/run-cpptest-action@2.0.2
336+
uses: parasoft/run-cpptest-action@2
337337
with:
338338
# C/C++test will use options from 'config.properties'.
339339
additionalParams: '-localsettings config.properties'

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ inputs:
4040
description: 'Command line pattern for running C/C++test.'
4141
required: false
4242
default: '${cpptestcli} -compiler "${compilerConfig}" -config "${testConfig}" -property report.format=${reportFormat} -report "${reportDir}" -module . -input "${input}" ${additionalParams}'
43+
outputs:
44+
exitCode:
45+
description: 'Exit code from the C/C++test analysis run.'
4346
runs:
44-
using: 'node20'
47+
using: 'node24'
4548
main: 'dist/index.js'

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,6 +2950,7 @@ async function run() {
29502950
core.info(messages_1.messages.run_started + runOptions.workingDir);
29512951
const theRunner = new runner.AnalysisRunner();
29522952
const outcome = await theRunner.run(runOptions);
2953+
core.setOutput("exitCode", outcome.exitCode.toString());
29532954
if (outcome.exitCode != 0) {
29542955
core.setFailed(messages_1.messages.failed_run_non_zero + outcome.exitCode);
29552956
}

0 commit comments

Comments
 (0)