fix: remove spaces in slr1 cells #125
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: SonarQube | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**/*.cpp' | |
| - '**/*.hpp' | |
| - '**/*.h' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| build: | |
| name: Build and analyze | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| env: | |
| BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Install Build Wrapper | |
| uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v5 | |
| - name: Build backend tests with coverage | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgtest-dev cmake | |
| cd /usr/src/gtest && sudo cmake . && sudo make && sudo cp lib/*.a /usr/lib | |
| cd $GITHUB_WORKSPACE | |
| build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} \ | |
| g++ -std=gnu++2a -O0 -g --coverage -fprofile-arcs -ftest-coverage \ | |
| backend/grammar.cpp \ | |
| backend/grammar_factory.cpp \ | |
| backend/ll1_parser.cpp \ | |
| backend/lr0_item.cpp \ | |
| backend/slr1_parser.cpp \ | |
| backend/symbol_table.cpp \ | |
| backend/tests.cpp \ | |
| -Ibackend/include \ | |
| -lgtest -lgtest_main \ | |
| -o test_runner | |
| - name: Run tests and dump XML | |
| run: ./test_runner | |
| - name: Install gcovr & generate SonarQube XML coverage | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcovr | |
| gcovr -r . --filter '.*backend/.*' --exclude-unreachable-branches --exclude-throw-branches --sonarqube --output coverage.xml | |
| - name: SonarQube Scan | |
| uses: SonarSource/sonarqube-scan-action@v6 | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONAR_KEY }} | |
| with: | |
| args: > | |
| --define sonar.cfamily.build-wrapper-output=${{ env.BUILD_WRAPPER_OUT_DIR }} | |
| --define sonar.coverageReportPaths=coverage.xml | |
| --define sonar.qualitygate.breakBuild=false | |