fix workflows #155
This file contains 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: cppcheck | |
on: | |
push: | |
pull_request: | |
schedule: | |
- cron: '13 15 * * 0' # 13:15 every Sunday | |
jobs: | |
ncdevtool_check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Pip install packages for ncdevtool | |
run: pip install -r ./src/devel/reqs/requirements_devel.txt | |
- name: ncdevtool checks | |
run: ./src/devel/bin/ncdevtool check -n fixme | |
build: | |
needs: [ ncdevtool_check ] | |
strategy: | |
matrix: | |
strictflag: [11, 17] | |
os: [ubuntu-latest, macos-latest,windows-latest] | |
name: ${{ matrix.os }}.strict${{ matrix.strictflag }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: src | |
- name: Install cppcheck | |
run: pip install cppcheck | |
- name: show cppcheck version | |
run: cppcheck --version | |
- name: Install Ninja (Linux) | |
if: runner.os == 'Linux' | |
run: sudo apt-get install ninja-build | |
- name: Install Ninja (macOS) | |
if: runner.os == 'macOS' | |
run: brew install ninja | |
- name: Set CMAKE_GENERATOR (Linux/macOS) | |
if: runner.os != 'Windows' | |
run: echo "CMAKE_GENERATOR=Ninja Multi-Config" >> $GITHUB_ENV | |
#NB: DNCRYSTAL_ENABLE_DATA!=EMBED since ncmat2cpp output of our data lib is too much for poor cppcheck | |
- name: Configure CMake | |
run: > | |
cmake -S ./src -B ./build | |
"-DCMAKE_CXX_CPPCHECK=cppcheck;--error-exitcode=3;--inline-suppr;--check-level=exhaustive" | |
"-DCMAKE_C_CPPCHECK=cppcheck;--error-exitcode=3;--inline-suppr;--check-level=exhaustive" | |
-DNCRYSTAL_ENABLE_TESTING=ON | |
-DNCRYSTAL_ENABLE_EXAMPLES=ON | |
-DNCRYSTAL_ENABLE_DATA=ON | |
-DNCRYSTAL_BUILD_STRICT=${{ matrix.strictflag }} | |
- name: Build and cppcheck Release | |
run: cmake --build ./build --config Release | |
- name: Build and cppcheck Debug | |
run: cmake --build ./build --config Debug |