Fixed compilation error using Emscripten #447
This file contains hidden or 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
| name: SonarCloud | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| SONAR_HOST_URL: "https://sonarcloud.io" | |
| BUILD_WRAPPER_OUT_DIR: bw-out | |
| SONAR_SCANNER_VERSION: 5.0.1.3006 | |
| steps: | |
| # ----------------------------- | |
| # CHECKOUT | |
| # ----------------------------- | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # ----------------------------- | |
| # INSTALL GCOVR (for calling gcov) | |
| # ----------------------------- | |
| - name: Install gcovr | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcovr | |
| # ----------------------------- | |
| # DOWNLOAD BUILD WRAPPER | |
| # ----------------------------- | |
| - name: Download SonarCloud Build Wrapper | |
| run: | | |
| curl -sSLo build-wrapper.zip "https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip" | |
| unzip build-wrapper.zip -d bw | |
| ls -R bw | |
| # ----------------------------- | |
| # COMPILE WITH BUILD WRAPPER | |
| # ----------------------------- | |
| - name: Build with Build Wrapper | |
| run: | | |
| BW="$(find bw -type f -name 'build-wrapper-linux-x86*' | head -n 1)" | |
| chmod +x "$BW" | |
| "$BW" --out-dir "$BUILD_WRAPPER_OUT_DIR" make clean all | |
| # ----------------------------- | |
| # GENERATE GCOV COVERAGE (raw .gcov files) | |
| # ----------------------------- | |
| - name: Generate GCOV coverage | |
| run: | | |
| gcovr -r . --gcov-executable gcov | |
| # ----------------------------- | |
| # INSTALL SONAR SCANNER | |
| # ----------------------------- | |
| - name: Install SonarScanner (manual) | |
| run: | | |
| curl -sSLo scanner.zip \ | |
| "https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip" | |
| unzip scanner.zip -d scanner | |
| mv scanner/sonar-scanner-${SONAR_SCANNER_VERSION}-linux sonar-scanner | |
| echo "${PWD}/sonar-scanner/bin" >> $GITHUB_PATH | |
| # ----------------------------- | |
| # RUN SONAR SCAN | |
| # ----------------------------- | |
| - name: Run SonarScanner | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| sonar-scanner \ | |
| -Dsonar.host.url="${{ env.SONAR_HOST_URL }}" \ | |
| -Dsonar.organization=alpertron \ | |
| -Dsonar.projectKey=alpertron_calculators \ | |
| -Dsonar.sources=. \ | |
| -Dsonar.exclusions="**/*.md, **/docs/**, OldApplets/**, **/*.java, **/build-wrapper-dump.json" \ | |
| -Dsonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \ | |
| -Dsonar.cfamily.gcov.reportsPath=. \ | |
| -Dsonar.cfamily.cache.enabled=false |