@@ -4,80 +4,9 @@ name: CI
44on : [push, pull_request]
55
66jobs :
7-
8- lint :
9- runs-on : ubuntu-24.04
10- strategy :
11- fail-fast : false
12- env :
13- BUILD_TYPE : Release
14- CMAKE_FLAGS : >
15- -DSPIRIT_UI_USE_IMGUI=ON
16- -DSPIRIT_UI_CXX_USE_QT=OFF
17- -DSPIRIT_ENABLE_PINNING=ON
18- -DSPIRIT_ENABLE_DEFECTS=ON
19- SOURCES : >
20- find
21- core/include/
22- core/src/
23- ui-cpp/utility/
24- ui-cpp/ui-imgui/include/
25- ui-cpp/ui-imgui/src/
26- -iname *.hpp -o -iname *.cpp"
27-
28- steps :
29- - uses : actions/checkout@v4
30-
31- - name : 📚 Install required system packages
32- run : |
33- sudo apt-get update
34- sudo apt-get install -y xorg-dev libglu1-mesa-dev libgtk-3-dev tree
35-
36- - uses : actions/setup-python@v5
37- with :
38- python-version : ' 3.10'
39-
40- - name : 📚 Install python packages
41- run : >
42- pip install --user numpy pylint
43- "black==22.10.0"
44- "clang-format==18.1.8"
45- "clang-tidy==18.1.8"
46-
47- - name : 📁 Create build folder
48- run : cmake -E make_directory ${{runner.workspace}}/build
49-
50- - name : ⚙ Configure
51- shell : bash
52- working-directory : ${{runner.workspace}}/build
53- run : cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE $CMAKE_FLAGS
54-
55- - name : 🧪 clang-format linting
56- if : always()
57- shell : bash
58- run : |
59- clang-format --version
60- OUTPUT=$($SOURCES | xargs clang-format -n 2>&1)
61- if [[ $OUTPUT ]]; then
62- echo "$OUTPUT"
63- exit 1
64- fi
65-
66- - name : 🧪 clang-tidy linting
67- if : always()
68- shell : bash
69- run : |
70- clang-tidy --version
71-
72- - name : 🧪 Python code formatting check
73- shell : bash
74- run : |
75- git ls-files core/python/{,**/}*.py | xargs black --check
76- git ls-files ui-python/{,**/}*.py | xargs black --check
77-
78- - name : 🧪 Python code quality checks, linting
79- shell : bash
80- run : pylint core/python/spirit --fail-under=8
7+ call-quality :
8+ uses : ./.github/workflows/quality.yml
9+ secrets : inherit
8110
8211 test-gcc :
8312 name : gcc ${{ matrix.parallelisation }} (${{ matrix.os }})
@@ -459,85 +388,6 @@ jobs:
459388 working-directory : ${{runner.workspace}}/build
460389 run : ctest -C $BUILD_TYPE -E $EXCLUDETESTS --output-on-failure
461390
462- test-coverage :
463- name : test coverage (${{ matrix.os }})
464- runs-on : ${{ matrix.os }}
465- strategy :
466- fail-fast : false
467- matrix :
468- include :
469- - os : ubuntu-22.04
470- env :
471- BUILD_TYPE : Debug
472- CMAKE_FLAGS : >
473- -DSPIRIT_UI_USE_IMGUI=OFF
474- -DSPIRIT_UI_CXX_USE_QT=OFF
475- -DSPIRIT_BUILD_TEST=ON
476- steps :
477- - uses : actions/checkout@v4
478-
479- - uses : actions/setup-python@v5
480- with :
481- python-version : ' 3.x'
482-
483- - name : 📚 Install python packages
484- run : pip install --user numpy
485-
486- - name : 📚 Install coverage packages
487- run : |
488- python -m pip install --upgrade pip
489- python -m pip install coverage 'coveralls<3'
490- sudo apt-get update
491- sudo apt-get install -y lcov
492-
493- - name : 📁 Create build folder
494- run : cmake -E make_directory ${{runner.workspace}}/build
495-
496- - name : ⚙ Configure (with coverage)
497- shell : bash
498- working-directory : ${{runner.workspace}}/build
499- run : >
500- cmake $GITHUB_WORKSPACE
501- -DCMAKE_BUILD_TYPE=$BUILD_TYPE
502- -DSPIRIT_TEST_COVERAGE=ON
503- $CMAKE_FLAGS
504-
505- - name : 🛠 Build
506- shell : bash
507- working-directory : ${{runner.workspace}}/build
508- run : cmake --build . --config $BUILD_TYPE -j 2
509-
510- - name : 🧪 Generate C++ coverage
511- shell : bash
512- working-directory : ${{runner.workspace}}/build
513- run : |
514- lcov -c -i --no-external --directory . --base-directory $GITHUB_WORKSPACE/core -o baseline.info
515- make test
516- lcov -c --no-external --directory . --base-directory $GITHUB_WORKSPACE/core -o after_test.info
517- lcov -a baseline.info -a after_test.info -o total_test.info
518- lcov -r total_test.info \*thirdparty\* \*/test/\* \*Collection\* \*DLL_\* -o coverage.info
519-
520- - name : ⬆ Upload C++ coverage
521- uses : codecov/codecov-action@v3
522- with :
523- files : ${{runner.workspace}}/build/coverage.info
524-
525- - name : 🧪 Generate Python API coverage
526- if : matrix.coverage == true
527- working-directory : ./core/python
528- env :
529- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
530- run : |
531- coverage run --source spirit --omit=spirit/spiritlib.py \
532- -m unittest discover \
533- --start-directory ./test \
534- --pattern "*.py" \
535- > cov.txt
536- head cov.txt
537- coverage report -m
538- coverage xml
539- coveralls
540-
541391 test-other-configurations :
542392 name : test ${{ matrix.configuration }} (${{ matrix.os }})
543393 runs-on : ${{ matrix.os }}
@@ -777,13 +627,12 @@ jobs:
777627 deploy-package :
778628 if : github.event_name != 'pull_request'
779629 needs :
780- - lint
630+ - call-quality
781631 - test-gcc
782632 - test-clang
783633 - test-nvcpp
784634 - test-msvc
785635 - test-debug
786- - test-coverage
787636 runs-on : ${{ matrix.os }}
788637 strategy :
789638 fail-fast : false
0 commit comments