Skip to content

Commit adc050f

Browse files
remove Sonar
1 parent 97953b8 commit adc050f

File tree

2 files changed

+6
-89
lines changed

2 files changed

+6
-89
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Main Workflow
22
on: [push, pull_request]
33
env:
4-
LLVM_VERSION: 15
4+
LLVM_VERSION: 19
55
jobs:
66
test:
77
if: github.event_name == 'push'
@@ -39,78 +39,12 @@ jobs:
3939
- working-directory: ${{github.workspace}}/build
4040
run: make test
4141

42-
sonarcloud:
43-
if: >
44-
github.event_name == 'pull_request' ||
45-
contains(github.ref, '/master') ||
46-
contains(github.ref, '/release') ||
47-
contains(github.event.head_commit.message, '#sonar')
48-
runs-on: ubuntu-latest
49-
env:
50-
SONAR_SCANNER_VERSION: 5.0.1.3006
51-
SONAR_SERVER_URL: "https://sonarcloud.io"
52-
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
55-
CC: gcc
56-
CXX: g++
57-
steps:
58-
- uses: actions/checkout@v4
59-
with:
60-
fetch-depth: 0
61-
- run: sudo apt install g++ g++-multilib gcc-multilib
62-
- uses: actions/setup-java@v4
63-
with:
64-
java-version: 17
65-
distribution: zulu
66-
- uses: actions/cache@v4
67-
with:
68-
path: ~/.sonar/cache
69-
key: ${{ runner.os }}-sonar
70-
restore-keys: ${{ runner.os }}-sonar
71-
- name: Download and set up sonar-scanner
72-
env:
73-
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
74-
run: |
75-
mkdir -p $HOME/.sonar
76-
curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
77-
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
78-
echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH
79-
- name: Download and set up build-wrapper
80-
env:
81-
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip
82-
run: |
83-
curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
84-
unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
85-
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
86-
# Pass NDEBUG to exclude assert() from coverage; see https://github.com/pavel-kirienko/o1heap/issues/9
87-
- name: Run build-wrapper
88-
run: |
89-
cmake tests -DCMAKE_BUILD_TYPE=Debug -DNO_STATIC_ANALYSIS=1 -DCMAKE_C_FLAGS='-DNDEBUG=1'
90-
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all
91-
make test
92-
gcov --preserve-paths --long-file-names $(find CMakeFiles/test_general_cov.dir -name '*.gcno')
93-
gcov --preserve-paths --long-file-names $(find CMakeFiles/test_private_cov.dir -name '*.gcno')
94-
# https://community.sonarsource.com/t/analyzing-a-header-only-c-library/51468
95-
- if: env.SONAR_TOKEN != ''
96-
run: >
97-
sonar-scanner
98-
--define sonar.projectKey="pavel-kirienko_o1heap"
99-
--define sonar.organization="pavel-kirienko"
100-
--define sonar.sources="o1heap/"
101-
--define sonar.sourceEncoding="UTF-8"
102-
--define sonar.cfamily.gcov.reportsPath="."
103-
--define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
104-
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}"
105-
--define sonar.login=${{ secrets.SONAR_TOKEN }}
106-
$([ -z "$GITHUB_BASE_REF" ] && echo "--define sonar.branch.name=${GITHUB_REF##*/}" || true)
107-
10842
style_check:
10943
if: github.event_name == 'push'
11044
runs-on: ubuntu-latest
11145
steps:
11246
- uses: actions/checkout@v4
113-
- uses: DoozyX/clang-format-lint-action@v0.15
47+
- uses: DoozyX/clang-format-lint-action@v0.20
11448
with:
11549
source: './o1heap ./tests'
11650
exclude: './tests/catch'

README.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# O(1) heap
22

33
[![Main Workflow](https://github.com/pavel-kirienko/o1heap/actions/workflows/main.yml/badge.svg)](https://github.com/pavel-kirienko/o1heap/actions/workflows/main.yml)
4-
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=pavel-kirienko_o1heap&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=pavel-kirienko_o1heap)
5-
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=pavel-kirienko_o1heap&metric=coverage)](https://sonarcloud.io/dashboard?id=pavel-kirienko_o1heap)
64

7-
O1heap is a highly deterministic constant-complexity memory allocator designed for
5+
O1Heap is a highly deterministic constant-complexity memory allocator designed for
86
hard real-time high-integrity embedded systems.
97
The name stands for *O(1) heap*.
108

@@ -254,15 +252,6 @@ The following tools should be available locally to conduct library development:
254252
- An AMD64 machine.
255253
- (optional) Valgrind.
256254

257-
### Conventions
258-
259-
The codebase shall follow the [Zubax C/C++ Coding Conventions](https://kb.zubax.com/x/84Ah).
260-
Compliance is enforced through the following means:
261-
262-
- Clang-Tidy -- invoked automatically while building the test suite.
263-
- Clang-Format -- invoked manually as `make format`; enforced in CI/CD automatically.
264-
- SonarCloud -- invoked by CI/CD automatically.
265-
266255
### Testing
267256

268257
Please refer to the continuous integration configuration to see how to invoke the tests.
@@ -273,32 +262,26 @@ Update the version number macro in the header file and create a new git tag like
273262

274263
### MISRA compliance
275264

276-
MISRA compliance is enforced with the help of the following tools:
265+
MISRA compliance is enforced with the help of:
277266

278267
- Clang-Tidy -- invoked automatically during the normal build process.
279-
- SonarCloud -- invoked as part of the continuous integration build.
280268

281269
Every intentional deviation shall be documented and justified in-place using the following notation,
282270
followed by the appropriate static analyser warning suppression statement:
283271

284272
```c
285273
// Intentional violation of MISRA: <valid reason here>
286-
// NOSONAR
287-
// NOLINT
274+
// NOLINT(*-specific-rule)
288275
```
289276

290277
The list of intentional deviations can be obtained by simply searching the codebase for the above comments.
291278

292-
Do not suppress compliance warnings using the means provided by static analysis tools because such deviations
293-
are impossible to track at the source code level.
294-
An exception applies for the case of false-positive (invalid) warnings -- those should not be mentioned in the codebase.
295-
296279
## Further reading
297280

298281
- [Timing-Predictable Memory Allocation In Hard Real-Time Systems](https://publikationen.sulb.uni-saarland.de/bitstream/20.500.11880/26614/1/diss.pdf), J. Herter, 2014.
299282
- [Worst case fragmentation of first fit and best fit storage allocation strategies](https://academic.oup.com/comjnl/article/20/3/242/751782), J. M. Robson, 1975.
300283
- [Dynamic Memory Allocation In SQLite](https://sqlite.org/malloc.html) -- on Robson proof and deterministic fragmentation.
301-
- *[Russian]* [Динамическая память в системах жёсткого реального времени](https://habr.com/ru/post/486650/) -- issues with dynamic memory allocation in modern embedded RTOS and related popular misconceptions.
284+
- [Динамическая память в системах жёсткого реального времени](https://habr.com/ru/post/486650/) -- issues with dynamic memory allocation in modern embedded RTOS and related popular misconceptions.
302285

303286
## Changelog
304287

0 commit comments

Comments
 (0)