4141 unit_testing : ON
4242 target : unit_testing
4343 install_uninstall_and_package : ON
44+ copy_dll : ON
4445 - name : ' Windows static library (ARM)'
4546 os : windows-11-arm
4647 arch : amd64_arm64
6970 unit_testing : ON
7071 target : unit_testing
7172 install_uninstall_and_package : ON
73+ copy_dll : ON
7274 - name : ' Linux static library (Intel)'
7375 os : ubuntu-22.04
7476 build_type : Release
8284 unit_testing : ON
8385 target : unit_testing
8486 install_uninstall_and_package : ON
87+ use_install_prefix : ON
8588 - name : ' Linux shared library (Intel)'
8689 os : ubuntu-22.04
8790 build_type : Release
9598 unit_testing : ON
9699 target : unit_testing
97100 install_uninstall_and_package : ON
101+ use_install_prefix : ON
98102 - name : ' Linux static library (ARM)'
99103 os : ubuntu-22.04-arm
100104 build_type : Release
@@ -108,6 +112,7 @@ jobs:
108112 unit_testing : ON
109113 target : unit_testing
110114 install_uninstall_and_package : ON
115+ use_install_prefix : ON
111116 - name : ' Linux shared library (ARM)'
112117 os : ubuntu-22.04-arm
113118 build_type : Release
@@ -121,8 +126,9 @@ jobs:
121126 unit_testing : ON
122127 target : unit_testing
123128 install_uninstall_and_package : ON
129+ use_install_prefix : ON
124130 - name : ' macOS static library (Intel)'
125- os : macos-14
131+ os : macos-13
126132 build_type : Release
127133 code_analysis : OFF
128134 code_coverage : OFF
@@ -133,10 +139,10 @@ jobs:
133139 shared_libs : OFF
134140 unit_testing : ON
135141 target : unit_testing
136- target_arch : " -DTARGET_ARCHITECTURE=Intel"
137142 install_uninstall_and_package : ON
143+ use_install_prefix : ON
138144 - name : ' macOS shared library (Intel)'
139- os : macos-14
145+ os : macos-13
140146 build_type : Release
141147 code_analysis : OFF
142148 code_coverage : OFF
@@ -147,8 +153,8 @@ jobs:
147153 shared_libs : ON
148154 unit_testing : ON
149155 target : unit_testing
150- target_arch : " -DTARGET_ARCHITECTURE=Intel"
151156 install_uninstall_and_package : ON
157+ use_install_prefix : ON
152158 - name : ' macOS static library (ARM)'
153159 os : macos-14
154160 build_type : Release
@@ -162,6 +168,7 @@ jobs:
162168 unit_testing : ON
163169 target : unit_testing
164170 install_uninstall_and_package : ON
171+ use_install_prefix : ON
165172 - name : ' macOS shared library (ARM)'
166173 os : macos-14
167174 build_type : Release
@@ -175,6 +182,7 @@ jobs:
175182 unit_testing : ON
176183 target : unit_testing
177184 install_uninstall_and_package : ON
185+ use_install_prefix : ON
178186 - name : ' JavaScript bindings'
179187 os : macos-14
180188 build_type : Release
@@ -394,86 +402,65 @@ jobs:
394402 wget https://github.com/opencor/gha/releases/download/gha/doxygen.tar.gz -O - | tar -xz
395403 sudo mv doxygen /usr/local/bin
396404 - name : Configure libOpenCOR
405+ shell : bash
397406 run : |
398- mkdir build
399- cd build
400- ${{ matrix.context }} cmake -G Ninja ${{ matrix.target_arch }} -DBUILD_TYPE=${{ matrix.build_type }} -DCODE_ANALYSIS=${{ matrix.code_analysis }} -DCODE_COVERAGE=${{ matrix.code_coverage }} -DDOCUMENTATION=${{ matrix.documentation }} -DINSTALL_PREFIX=${{ github.workspace }}/install -DJAVASCRIPT_BINDINGS=${{ matrix.javascript_support }} -DJAVASCRIPT_UNIT_TESTING=${{ matrix.javascript_support }} -DMEMORY_CHECKS=${{ matrix.memory_checks }} -DPYTHON_BINDINGS=${{ matrix.python_support }} -DPYTHON_UNIT_TESTING=${{ matrix.python_support }} -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=${{ matrix.unit_testing }} ..
407+ if [ '${{ matrix.use_install_prefix }}' == 'ON' ]; then export D_INSTALL_PREFIX='-DINSTALL_PREFIX=${{ github.workspace }}/install'; fi
408+ ${{ matrix.context }} cmake -G Ninja -S . -B build -DBUILD_TYPE=${{ matrix.build_type }} -DCODE_ANALYSIS=${{ matrix.code_analysis }} -DCODE_COVERAGE=${{ matrix.code_coverage }} -DDOCUMENTATION=${{ matrix.documentation }} $D_INSTALL_PREFIX -DJAVASCRIPT_BINDINGS=${{ matrix.javascript_support }} -DJAVASCRIPT_UNIT_TESTING=${{ matrix.javascript_support }} -DMEMORY_CHECKS=${{ matrix.memory_checks }} -DPYTHON_BINDINGS=${{ matrix.python_support }} -DPYTHON_UNIT_TESTING=${{ matrix.python_support }} -DSHARED_LIBS=${{ matrix.shared_libs }} -DUNIT_TESTING=${{ matrix.unit_testing }}
401409 - name : Build libOpenCOR
402- if : ${{ (matrix.install_uninstall_and_package == 'ON') || (matrix.javascript_support == 'ON') || (matrix.code_analysis == 'ON') || (matrix.code_coverage == 'ON') || (matrix.memory_checks == 'ON') }}
403- run : |
404- cd build
405- ninja
410+ if : ${{ (matrix.install_uninstall_and_package == 'ON') || (matrix.code_analysis == 'ON') || (matrix.code_coverage == 'ON') || (matrix.memory_checks == 'ON') }}
411+ run : cmake --build build
406412 - name : Unit testing
407413 if : ${{ ((matrix.unit_testing == 'ON') && (matrix.code_analysis == 'OFF')) || (matrix.code_coverage == 'ON') || (matrix.memory_checks == 'ON') }}
408- run : |
409- cd build
410- ninja ${{ matrix.target }}
414+ run : cmake --build build --target ${{ matrix.target }}
411415 - name : JavaScript unit testing
412416 if : ${{ matrix.javascript_support == 'ON' }}
413- run : |
414- cd build
415- ninja ${{ matrix.target }}
417+ run : cmake --build build --target ${{ matrix.target }}
416418 - name : Python unit testing
417419 if : ${{ matrix.python_support == 'ON' }}
418- run : |
419- cd build
420- ninja ${{ matrix.target }}
420+ run : cmake --build build --target ${{ matrix.target }}
421421 - name : Python unit testing report
422422 if : ${{ matrix.python_support == 'ON' }}
423- run : |
424- cd build
425- ninja ${{ matrix.target }}_report
423+ run : cmake --build build --target ${{ matrix.target }}_report
426424 - name : Code formatting
427425 if : ${{ matrix.target == 'check_code_formatting' }}
428- run : |
429- cd build
430- ninja ${{ matrix.target }}
426+ run : cmake --build build --target ${{ matrix.target }}
431427 - name : JavaScript code formatting
432428 if : ${{ matrix.target == 'javascript_check_code_formatting' }}
433- run : |
434- cd build
435- ninja ${{ matrix.target }}
429+ run : cmake --build build --target ${{ matrix.target }}
436430 - name : Python code formatting
437431 if : ${{ matrix.target == 'python_check_code_formatting' }}
438- run : |
439- cd build
440- ninja ${{ matrix.target }}
432+ run : cmake --build build --target ${{ matrix.target }}
441433 - name : Code analysis
442434 if : ${{ matrix.name == 'Code analysis' }}
443- run : |
444- cd build
445- ninja
435+ run : cmake --build build
446436 - name : Code coverage
447437 if : ${{ matrix.code_coverage == 'ON' }}
448- run : |
449- cd build
450- ninja ${{ matrix.target }}
451- if [ `ninja ${{ matrix.target }} | grep TOTAL | sed 's/ /\n/g' | grep "100.00%" | wc -l | sed 's/ //g'` -eq 4 ]; then exit 0; else exit 1; fi
438+ run : if [ `cmake --build build --target ${{ matrix.target }} | grep TOTAL | sed 's/ /\n/g' | grep "100.00%" | wc -l | sed 's/ //g'` -eq 4 ]; then exit 0; else exit 1; fi
452439 - name : Code coverage report
453440 if : ${{ matrix.code_coverage == 'ON' }}
454- run : |
455- cd build
456- ninja ${{ matrix.target }}_report
441+ run : cmake --build build --target ${{ matrix.target }}_report
457442 - name : Memory checks
458443 if : ${{ matrix.memory_checks == 'ON' }}
459- run : |
460- cd build
461- ninja ${{ matrix.target }}
444+ run : cmake --build build --target ${{ matrix.target }}
462445 - name : Documentation
463446 if : ${{ matrix.documentation == 'ON' }}
464- run : |
465- cd build
466- ninja ${{ matrix.target }}
447+ run : cmake --build build --target ${{ matrix.target }}
467448 - name : Install libOpenCOR
468449 if : ${{ matrix.install_uninstall_and_package == 'ON' }}
450+ run : cmake --build build --target install
451+ - name : Test libOpenCOR
452+ if : ${{ matrix.install_uninstall_and_package == 'ON' }}
453+ shell : bash
469454 run : |
470- cd build
471- ninja install
455+ cd tests/install
456+ if [ '${{ matrix.use_install_prefix }}' == 'ON' ]; then export D_CMAKE_PREFIX_PATH='-DCMAKE_PREFIX_PATH=${{ github.workspace }}/install'; fi
457+ cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} $D_CMAKE_PREFIX_PATH
458+ cmake --build build
459+ if [ '${{ matrix.copy_dll }}' == 'ON' ]; then cp "C:/Program Files (x86)/libOpenCOR/bin/libOpenCOR.dll" build; fi
460+ build/testInstall
472461 - name : Uninstall libOpenCOR
473462 if : ${{ matrix.install_uninstall_and_package == 'ON' }}
474- run : |
475- cd build
476- ninja uninstall
463+ run : cmake --build build --target uninstall
477464 - name : Package libOpenCOR
478465 if : ${{ matrix.install_uninstall_and_package == 'ON' }}
479466 run : |
@@ -486,7 +473,9 @@ jobs:
486473 pip3 install .
487474 - name : Test libOpenCOR Python
488475 if : ${{ matrix.pip_install_test_and_uninstall == 'ON' }}
489- run : python3 -c "import libopencor as oc; print(f'This is libOpenCOR version {oc.version_string()}.')"
476+ run : |
477+ cd tests/install/bindings/python
478+ python3 test_install.py
490479 - name : pip uninstall libOpenCOR
491480 if : ${{ matrix.pip_install_test_and_uninstall == 'ON' }}
492481 run : pip3 uninstall -y libopencor
0 commit comments