Skip to content

Commit

Permalink
SCCPPGHA-6 Support Running on Linux ARM64
Browse files Browse the repository at this point in the history
  • Loading branch information
friedbyalice committed May 24, 2024
1 parent 5c3c391 commit 2df64fa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ jobs:
grep "build-wrapper-dir=install-directory/build-wrapper-win-x86" output
grep "build-wrapper-bin=install-directory/build-wrapper-win-x86/build-wrapper-win-x86-64.exe" output
- name: Linux
- name: Linux_X64
shell: bash
env:
OS: 'Linux'
Expand All @@ -163,6 +163,26 @@ jobs:
grep "build-wrapper-dir=install-directory/build-wrapper-linux-x86" output
grep "build-wrapper-bin=install-directory/build-wrapper-linux-x86/build-wrapper-linux-x86-64" output
- name: Linux_ARM64
shell: bash
env:
OS: 'Linux'
ARCH: 'ARM64'
run: |
./scripts/configure_paths.sh > output
grep -v "::error::" output
echo "- Check sonar-scanner:"
grep "sonar-scanner-url=https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-vX.Y.Z.MMMM-linux.zip" output
grep "sonar-scanner-sha=DOWNLOAD-SHA-LINUX" output
grep "sonar-scanner-dir=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux" output
grep "sonar-scanner-bin=install-directory/sonar-scanner-vX.Y.Z.MMMM-linux/bin/sonar-scanner" output
echo "- Check build-wrapper:"
grep "build-wrapper-url=http://sonar-host.com/static/cpp/build-wrapper-linux-aarch64.zip" output
grep "build-wrapper-dir=install-directory/build-wrapper-linux-aarch64" output
grep "build-wrapper-bin=install-directory/build-wrapper-linux-aarch64/build-wrapper-linux-aarch64" output
- name: macOSX_X64
shell: bash
env:
Expand Down
14 changes: 11 additions & 3 deletions scripts/configure_paths.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

if [[ ${ARCH} != "X64" && ! ( ${OS} == "macOS" && ${ARCH} == "ARM64" ) ]]; then
if [[ ${ARCH} != "X64" && ! ( (${OS} == "macOS" && ${ARCH} == "ARM64") || (${OS} == "Linux" && ${ARCH} == "ARM64") ) ]]; then
echo "::error::Architecture '${ARCH}' is unsupported by build-wrapper"
exit 1
fi
Expand All @@ -16,11 +16,19 @@ case ${OS} in
;;
Linux)
SONAR_SCANNER_SUFFIX="linux"
BUILD_WRAPPER_SUFFIX="linux-x86"
SONAR_SCANNER_NAME="sonar-scanner"
BUILD_WRAPPER_NAME="build-wrapper-linux-x86-64"
SONAR_SCANNER_URL="${SONAR_SCANNER_URL_LINUX}"
SONAR_SCANNER_SHA="${SONAR_SCANNER_SHA_LINUX}"
case ${ARCH} in
X64)
BUILD_WRAPPER_SUFFIX="linux-x86"
BUILD_WRAPPER_NAME="build-wrapper-linux-x86-64"
;;
ARM64)
BUILD_WRAPPER_SUFFIX="linux-aarch64"
BUILD_WRAPPER_NAME="build-wrapper-linux-aarch64"
;;
esac
;;
macOS)
SONAR_SCANNER_SUFFIX="macosx"
Expand Down

0 comments on commit 2df64fa

Please sign in to comment.