-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQCPPGHA-9 Extend action to support C, C++, and Objective-C projects
- Loading branch information
1 parent
844ce27
commit 5c44ebe
Showing
15 changed files
with
1,078 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: QA Deprecated C and C++ action | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
output-test: | ||
name: Action outputs | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] | ||
cache: [true, false] | ||
include: | ||
- arch: X64 | ||
- os: macos-latest | ||
arch: ARM64 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Specifying a specific architecture of the runner is not possible for Github hosted runners | ||
# We can only check if the runner architecture matches the expected one | ||
- name: check_runner_arch | ||
shell: bash | ||
run: | | ||
echo "Runner architecture: ${{ runner.arch }}" | ||
if [[ "${{ runner.arch }}" != "${{ matrix.arch }}" ]]; then | ||
echo "##[error]Runner architecture does not match the expected one" | ||
exit 1 | ||
fi | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
||
- name: Run SonarQube C/C++ action | ||
id: run-action | ||
uses: ./deprecated-c-cpp-action | ||
env: | ||
SONAR_HOST_URL: 'https://next.sonarqube.com/sonarqube/' | ||
with: | ||
cache-binaries: ${{ matrix.cache }} | ||
|
||
- name: SONAR_HOST_URL is set | ||
shell: bash | ||
run: | | ||
[[ $SONAR_HOST_URL == "https://next.sonarqube.com/sonarqube/" ]] | ||
- name: sonar-scanner is installed and in PATH | ||
run: | | ||
sonar-scanner --help | grep "usage: sonar-scanner " | ||
- name: sonar-scanner-binary output is correct | ||
shell: bash | ||
env: | ||
BINARY: ${{ steps.run-action.outputs.sonar-scanner-binary }} | ||
run: | | ||
"$BINARY" --help | grep "usage: sonar-scanner " | ||
# build-wrapper does not have --help or equivalent option. | ||
# Pass to few arguments and ignore error code | ||
- name: build-wrapper is installed and in PATH on Windows | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
(build-wrapper-win-x86-64.exe || true) | grep "build-wrapper, version " | ||
- name: build-wrapper is installed and in PATH on Linux | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
run: | | ||
(build-wrapper-linux-x86-64 || true) | grep "build-wrapper, version " | ||
- name: build-wrapper is installed and in PATH on macOS | ||
if: runner.os == 'macOs' | ||
shell: bash | ||
run: | | ||
(build-wrapper-macosx-x86 || true) | grep "build-wrapper, version " | ||
- name: build-wrapper-binary output is correct | ||
shell: bash | ||
env: | ||
BINARY: ${{ steps.run-action.outputs.build-wrapper-binary }} | ||
run: | | ||
("$BINARY" || true) | grep "build-wrapper, version " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: QA Install Build Wrapper action | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
output-test: | ||
name: Action outputs | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] | ||
cache: [true, false] | ||
include: | ||
- arch: X64 | ||
- os: macos-latest | ||
arch: ARM64 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Specifying a specific architecture of the runner is not possible for Github hosted runners | ||
# We can only check if the runner architecture matches the expected one | ||
- name: check_runner_arch | ||
shell: bash | ||
run: | | ||
echo "Runner architecture: ${{ runner.arch }}" | ||
if [[ "${{ runner.arch }}" != "${{ matrix.arch }}" ]]; then | ||
echo "##[error]Runner architecture does not match the expected one" | ||
exit 1 | ||
fi | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
|
||
- name: Run SonarQube C/C++ action | ||
id: run-action | ||
uses: ./install-build-wrapper | ||
env: | ||
SONAR_HOST_URL: 'https://next.sonarqube.com/sonarqube/' | ||
with: | ||
cache-binaries: ${{ matrix.cache }} | ||
|
||
- name: SONAR_HOST_URL is set | ||
shell: bash | ||
run: | | ||
[[ $SONAR_HOST_URL == "https://next.sonarqube.com/sonarqube/" ]] | ||
# build-wrapper does not have --help or equivalent option. | ||
# Pass to few arguments and ignore error code | ||
- name: build-wrapper is installed and in PATH on Windows | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
(build-wrapper-win-x86-64.exe || true) | grep "build-wrapper, version " | ||
- name: build-wrapper is installed and in PATH on Linux | ||
if: runner.os == 'Linux' | ||
shell: bash | ||
run: | | ||
(build-wrapper-linux-x86-64 || true) | grep "build-wrapper, version " | ||
- name: build-wrapper is installed and in PATH on macOS | ||
if: runner.os == 'macOs' | ||
shell: bash | ||
run: | | ||
(build-wrapper-macosx-x86 || true) | grep "build-wrapper, version " | ||
- name: build-wrapper-binary output is correct | ||
shell: bash | ||
env: | ||
BINARY: ${{ steps.run-action.outputs.build-wrapper-binary }} | ||
run: | | ||
("$BINARY" || true) | grep "build-wrapper, version " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: QA | ||
name: QA Main action | ||
|
||
on: | ||
push: | ||
|
Oops, something went wrong.