New folder structure for C++ code #2284
Workflow file for this run
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: Checks | |
on: | |
pull_request: | |
types: [opened, synchronize] | |
branches: [ master, dev] | |
merge_group: | |
types: [checks_requested] | |
branches: [master] | |
jobs: | |
linux-clang-build: | |
runs-on: ubuntu-latest | |
env: | |
QT_SELECT: qt6 | |
SCCACHE_GHA_ENABLED: "true" | |
SCCACHE_CACHE_SIZE: "2G" | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install clang qt6-base-dev libglvnd-dev zlib1g-dev libfftw3-dev ninja-build python3-distutils python3-numpy | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Get CMake | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: '3.16.3' | |
- name: Print CMake version | |
run: cmake --version | |
- name: configure | |
run: > | |
cmake | |
-B build | |
-G Ninja | |
-D CMAKE_BUILD_TYPE=Release | |
-D MRTRIX_BUILD_TESTS=ON | |
-D MRTRIX_STL_DEBUGGING=ON | |
-D MRTRIX_WARNINGS_AS_ERRORS=ON | |
-D CMAKE_C_COMPILER=clang | |
-D CMAKE_CXX_COMPILER=clang++ | |
- name: build | |
run: cmake --build build | |
- name: unit tests | |
run: cd build && ctest -L unittest --output-on-failure | |
- name: binary tests | |
run: cd build && ctest -L binary --output-on-failure | |
# | |
# - name: limited script tests | |
# run: cd build && ctest -L pythonci --output-on-failure | |
- name: check command documentation | |
run: ./docs/generate_user_docs.sh --build-dir build && git diff --exit-code docs/ | |
linux-gcc-build: | |
runs-on: ubuntu-latest | |
env: | |
QT_SELECT: qt6 | |
SCCACHE_GHA_ENABLED: "true" | |
SCCACHE_CACHE_SIZE: "2G" | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install g++-9 qt6-base-dev libglvnd-dev zlib1g-dev libfftw3-dev ninja-build python3-numpy | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Get CMake | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: '3.16.3' | |
- name: Print CMake version | |
run: cmake --version | |
- name: configure | |
run: > | |
cmake | |
-B build | |
-G Ninja | |
-D CMAKE_BUILD_TYPE=Release | |
-D MRTRIX_BUILD_TESTS=ON | |
-D MRTRIX_STL_DEBUGGING=ON | |
-D MRTRIX_WARNINGS_AS_ERRORS=ON | |
- name: build | |
run: cmake --build build | |
- name: unit tests | |
run: cd build && ctest -L unittest --output-on-failure | |
- name: binary tests | |
run: cd build && ctest -L binary --output-on-failure | |
# | |
# - name: limited script tests | |
# run: cd build && ctest -L pythonci --output-on-failure | |
macos-build: | |
runs-on: macos-latest | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
SCCACHE_CACHE_SIZE: "2G" | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- name: install dependencies | |
run: | | |
brew bundle --file=${{ github.workspace }}/.brewfile | |
brew link --force qt | |
brew install numpy | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Get CMake | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: '3.21.0' | |
- name: Print CMake version | |
run: cmake --version | |
- name: configure | |
run: > | |
export PATH=/usr/local/opt/qt/bin:$PATH; | |
cmake | |
-B build | |
-G Ninja | |
-D CMAKE_BUILD_TYPE=Release | |
# Deprioritize /Library/Frameworks in favour of Homebrew search paths | |
-D CMAKE_FIND_FRAMEWORK=LAST | |
-D MRTRIX_BUILD_TESTS=ON | |
-D MRTRIX_STL_DEBUGGING=ON | |
-D MRTRIX_USE_PCH=OFF | |
-D MRTRIX_WARNINGS_AS_ERRORS=ON | |
- name: build | |
run: cmake --build build | |
- name: unit tests | |
run: cd build && ctest -L unittest --output-on-failure | |
- name: binary tests | |
run: cd build && ctest -L binary --output-on-failure | |
# | |
# - name: limited script tests | |
# run: cd build && ctest -L pythonci --output-on-failure | |
windows-build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
env: | |
CHERE_INVOKING: enabled_from_arguments | |
MINGW_PACKAGE_PREFIX: mingw-w64-ucrt-x86_64 | |
SCCACHE_GHA_ENABLED: "true" | |
SCCACHE_CACHE_SIZE: "2G" | |
SCCACHE_DIR: ${{ github.workspace }}/.sccache | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
submodules: true | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: UCRT64 | |
release: false | |
install: | | |
git | |
python | |
${{env.MINGW_PACKAGE_PREFIX}}-bc | |
${{env.MINGW_PACKAGE_PREFIX}}-cmake | |
${{env.MINGW_PACKAGE_PREFIX}}-diffutils | |
${{env.MINGW_PACKAGE_PREFIX}}-fftw | |
${{env.MINGW_PACKAGE_PREFIX}}-gcc | |
${{env.MINGW_PACKAGE_PREFIX}}-ninja | |
${{env.MINGW_PACKAGE_PREFIX}}-pkg-config | |
${{env.MINGW_PACKAGE_PREFIX}}-qt6-base | |
${{env.MINGW_PACKAGE_PREFIX}}-qt6-svg | |
${{env.MINGW_PACKAGE_PREFIX}}-zlib | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: export sccache to msys2 shell | |
run: | | |
export SCCACHE_UNIX_PATH=$(cygpath -u "$SCCACHE_PATH") | |
echo "SCCACHE_UNIX_PATH=$SCCACHE_UNIX_PATH" >> $GITHUB_ENV | |
- name: configure | |
run: > | |
cmake | |
-B build | |
-G Ninja | |
-D CMAKE_BUILD_TYPE=Release | |
-D MRTRIX_BUILD_TESTS=ON | |
-D MRTRIX_STL_DEBUGGING=ON | |
-D MRTRIX_WARNINGS_AS_ERRORS=ON | |
-D CMAKE_CXX_COMPILER_LAUNCHER=${{env.SCCACHE_UNIX_PATH}} . | |
- name: build | |
run: cmake --build build | |
- name: unit tests | |
run: cd build && ctest -L unittest --output-on-failure | |
- name: binary tests | |
run: cd build && ctest -L binary --output-on-failure | |
# | |
# - name: limited script tests | |
# run: cd build && ctest -L pythonci --output-on-failure | |
secondary-checks: | |
runs-on: ubuntu-latest | |
env: | |
QT_SELECT: qt6 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install pylint python3-sphinx sphinx-rtd-theme-common python3-recommonmark python3-sphinx-rtd-theme python3-pip python3-sphinx-notfound-page | |
- name: check syntax | |
run: ./check_syntax || { cat syntax.log; false; } | |
- name: pylint | |
run: | | |
./run_pylint || { cat pylint.log; false; } | |
- name: check copyright headers | |
run: ./update_copyright && git diff --exit-code | |
- name: check building of documentation | |
run: python3 -m sphinx -n -N -W -w sphinx.log docs/ tmp/ | |
- name: clang-format check | |
uses: DoozyX/[email protected] | |
with: | |
source: '.' | |
extensions: 'h,cpp' | |
clangFormatVersion: 16 | |
# Ignore third party headers | |
exclude: './thirdparty ./_deps' |