-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathaction.yml
54 lines (50 loc) · 2.01 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: 'SonarCloud Scan for C and C++'
description: >
Scan your C and C++ code with SonarQube Cloud. (Formerly SonarCloud)
branding:
icon: check
color: green
inputs:
installation-path:
description: 'Directory where the Sonar Scanner CLI and build wrapper will be installed. Created if does not exists.'
required: false
default: '.sonar'
cache-binaries:
description: 'Controls if installed binaries are cached using GitHub cache.'
required: false
default: 'true'
outputs:
sonar-scanner-binary:
description: "Absolute path to sonar-scanner binary."
value: ${{ steps.setup-outputs.outputs.sonar-scanner-binary }}
build-wrapper-binary:
description: "Absolute path to build-wrapper binary."
value: ${{ steps.setup-outputs.outputs.build-wrapper-binary }}
runs:
using: "composite"
steps:
- name: Deprecation warning
shell: bash
run: |
echo "::warning title=SonarScanner::This action is deprecated and will be removed in a future release. Please use the sonarqube-scan-action and its install-build-wrapper sub-action instead."
- name: SonarQube Cloud Scan
id: scan
uses: sonarsource/sonarqube-github-c-cpp@25a2efe466506d2293f19f2e3062df4247477464
env:
SONAR_HOST_URL: "https://sonarcloud.io"
with:
installation-path: ${{ inputs.installation-path }}
cache-binaries: ${{ inputs.cache-binaries }}
- name: Setup action outputs
id: setup-outputs
shell: bash
env:
SONAR_SCANNER_BINARY: ${{ steps.scan.outputs.sonar-scanner-binary }}
BUILD_WRAPPER_BINARY: ${{ steps.scan.outputs.build-wrapper-binary }}
run: |
echo "::group::Action outputs"
echo "sonar-scanner-binary=${SONAR_SCANNER_BINARY}" >> $GITHUB_OUTPUT
echo "'sonar-scanner-binary' output set to '${SONAR_SCANNER_BINARY}'"
echo "build-wrapper-binary=${BUILD_WRAPPER_BINARY}" >> $GITHUB_OUTPUT
echo "'build-wrapper-binary' output set to '${BUILD_WRAPPER_BINARY}'"
echo "::endgroup::"