-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve CI testing #182
Comments
Hi, It deals with most the analysis tools you asked + some others
---
name: pre-commit
on:
pull_request:
push:
paths-ignore:
- docs/**
branches: [main]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install packages
run: sudo apt-get install clang-tidy cppcheck iwyu cmake
- name: 🔧 Configure
run: cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DBUILD_DOCS=OFF -DBUILD_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_NUMBER_JOBS=2 -DCMAKE_NUMBER_JOBS_TESTS=1
- uses: pre-commit/[email protected]
---
ci:
skip: [cppcheck, include-what-you-use, clang-tidy]
default_install_hook_types:
- pre-commit
- pre-merge-commit
- pre-push
- prepare-commit-msg
- commit-msg
- post-commit
- post-checkout
- post-merge
- post-rewrite
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
args: [--maxkb=200]
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-vcs-permalinks
- id: destroyed-symlinks
- id: detect-private-key
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
args: [--fix=lf]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-yaml
args: [--allow-multiple-documents]
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: check-mailmap
name: detect if an email address needs to be added to mailmap
- id: git-check
name: check for conflict markers and core.whitespace errors
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.0
hooks:
- id: remove-crlf
- id: remove-tabs
name: tabs remover
args: [--whitespaces-count, '2']
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:
- id: codespell
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.2
hooks:
- id: yamlfmt
name: format YAML files
args: [--mapping, '2', --sequence, '2', --offset, '0', --width, '250']
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.4.0
hooks:
- id: editorconfig-checker
name: check .editorconfig rules
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.32.1
hooks:
- id: markdownlint
args: [--config=.markdownlint.yml, scan]
- repo: https://github.com/Kr4is/cmake-format-precommit
rev: v0.6.14
hooks:
- id: cmake-format
args: [--config=.cmake-format.yml]
- id: cmake-lint
args: [--config=.cmake-linter.yml]
- repo: https://github.com/Takishima/cmake-pre-commit-hooks
rev: v1.5.3
hooks:
- id: clang-tidy
args: [-Bbuild, --config=]
- id: cppcheck
args: [-Bbuild, --suppressions-list=.cppcheck]
- id: include-what-you-use
args: [-Bbuild, -p, build, --jobs, '10']
- id: lizard
args: [--CCN, '50', --length, '150', --arguments, '20', --warnings_only, -x, '*/*tests*/*', -x, '*/*build*/*', ./]
- repo: https://gitlab.com/daverona/pre-commit/cpp
rev: 0.8.0
hooks:
- id: cpplint
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v14.0.6
hooks:
- id: clang-format Feel free to skip what is irrelevant, useless to you :) For the config files you can adapt some from here : https://github.com/flagarde/Khaos and tune them for your needs |
For the tests with Ubuntu clang +gcc you can use The docker containers are done by https://github.com/flagarde/ci . It still in very beta but you can have a try. the containers are by design very limited in software you need to install them on the CI |
MacOS clang: MacOS GCC: Windows: MinGW - GCC, clang, Cygwin - GCC, clang I tried and I gave up :( Fell free to copy and adapt. I'm would be really happy if you fin some improvments too :) |
Really nice! Thank you. I have looked briefly over them and they all look really great. We might want to stick with the official github template though, but I'll look into that when the window class stuff is done. |
We should improve the CI testing coverage by doing:
Other things
Analysis tools
Compilers
The text was updated successfully, but these errors were encountered: