Skip to content

attempt less lines of confusion. #1575

attempt less lines of confusion.

attempt less lines of confusion. #1575

Workflow file for this run

name: SonarCloud

Check failure on line 1 in .github/workflows/sonarsource.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/sonarsource.yml

Invalid workflow file

Invalid `steps` value - steps should be list of `uses` or `run` items
on:
pull_request:
types: [ labeled ]
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
remove-label:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'run-sonarsource' }}
steps:
run: |
gh pr edit $PR_URL --remove-label run-sonarsource
build:
name: Build and analyze
needs: remove-label
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v2
with:
cmake-version: ${{ env.DESIRED_CMAKE_VERSION }}
- name: Install packages
run: |
sudo apt-get install bison ccache flex lcov libfl-dev \
python3-dev python3-pip libfmt-dev libspdlog-dev
shell: bash
- name: Set up Python3
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install Python3 dependencies
working-directory: ${{runner.workspace}}/nmodl
run: |
pip3 install -U pip setuptools
pip3 install --user -r requirements.txt
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Configure project
shell: bash
working-directory: ${{runner.workspace}}/nmodl
run: |
mkdir build
# Ubuntu installs Catch2 v2, we need v3.
cmake -S . -B build \
-DPYTHON_EXECUTABLE=$(which python3) \
-DNMODL_3RDPARTY_USE_SPDLOG=Off \
-DNMODL_3RDPARTY_USE_FMT=Off \
-DNMODL_3RDPARTY_USE_CATCH2=On \
-DCMAKE_BUILD_TYPE=Debug
- name: Run build-wrapper
working-directory: ${{runner.workspace}}/nmodl
run: |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --verbose
- name: Run sonar-scanner
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"