Skip to content

Commit

Permalink
SonarQube - inject arch (openbikesensor#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
amandel authored Jan 12, 2021
1 parent 8b83d03 commit 0d42a78
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions .github/fake-cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

/github/home/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g++ \
"$@" 2>&1 \
| sed 's|: xtensa-esp32-elf|: le32-unknown-nacl|g' \
| sed 's|=xtensa-esp32-elf|=le32-unknown-nacl|g'
15 changes: 6 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
echo $VERSION > VERSION
echo Building OBS Version: $VERSION
sed -i 's|-DBUILD_NUMBER=\\"-dev\\"|-DBUILD_NUMBER=\\"'${SEPARATOR}${PATCH}'\\"|' platformio.ini
echo "SONAR_SCANNER_VERSION=4.5.0.2216" >> $GITHUB_ENV
echo "SONAR_SCANNER_VERSION=4.6.0.2311" >> $GITHUB_ENV
- name: Cache SonarCloud packages
id: cache-sonar
Expand All @@ -51,8 +51,8 @@ jobs:
path: |
~/.sonar/cache
sonarqube
key: ${{ runner.os }}-sonar-${{ env.SONAR_SCANNER_VERSION }}-ng
restore-keys: ${{ runner.os }}-sonar-${{ env.SONAR_SCANNER_VERSION }}-ng
key: ${{ runner.os }}-sonar-${{ env.SONAR_SCANNER_VERSION }}-ng2
restore-keys: ${{ runner.os }}-sonar-${{ env.SONAR_SCANNER_VERSION }}-ng2

- name: Install SonarQube dependencies
if: steps.cache-sonar.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -108,11 +108,9 @@ jobs:
sonarqube-out/build-wrapper-dump.json
sed -i 's|\.pio/|bin/.pio/|g' \
sonarqube-out/build-wrapper-dump.json
# fake le32-unknown-nacl did not help
#sed -i 's|=xtensa-esp32-elf|=le32-unknown-nacl|g' \
# sonarqube-out/build-wrapper-dump.json
#sed -i 's| xtensa-esp32-elf| le32-unknown-nacl|g' \
# sonarqube-out/build-wrapper-dump.json
# replace gcc with our script that reports the fake arch "le32-unknown-nacl"
sed -i "s|/github/home/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g..|`pwd`/.github/fake-cc|g" \
sonarqube-out/build-wrapper-dump.json
./sonarqube/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin/sonar-scanner \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=friends-of-openbikesensor \
Expand All @@ -134,7 +132,6 @@ jobs:
COPYRIGHT-ESP.html
LICENSE-ARDUINO-ESP32.md
LICENSE
sonarqube-out/build-wrapper-dump.json
if-no-files-found: error

- name: Upload Build Asset Initial Flash
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.idea/serialmonitor_settings.xml
.idea/deployment.xml
.idea/modules.xml
*esp32.bin
.pio
.vscode/.browse.c_cpp.db*
Expand Down

0 comments on commit 0d42a78

Please sign in to comment.