Skip to content

Apply formatting for C++ using clang-format #1550

Apply formatting for C++ using clang-format

Apply formatting for C++ using clang-format #1550

Workflow file for this run

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:
CFLAGS: -Werror
QT_SELECT: qt5
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"
CXX_COMPILER_LAUNCHER: sccache
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install clang libqt5opengl5-dev libqt5svg5-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev python3-numpy
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: configure
run: ./configure -assert || { cat configure.log; false; }
- name: build
run: ./build -nowarnings -persistent -nopaginate || { cat build.log; false; }
- name: unit tests
run: ./run_tests units || { cat testing_units.log; false; }
- name: binary tests
run: ./run_tests binaries || { cat testing_binaries.log; false; }
linux-gcc-build:
runs-on: ubuntu-latest
env:
CXX: g++-9
CFLAGS: -Werror
QT_SELECT: qt5
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"
CXX_COMPILER_LAUNCHER: sccache
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install g++-9 libqt5opengl5-dev libqt5svg5-dev libglvnd-dev libeigen3-dev zlib1g-dev libfftw3-dev
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: configure
run: ./configure -nooptim || { cat configure.log; false; }
- name: build
run: ./build -nowarnings -persistent -nopaginate || { cat build.log; false; }
macos-build:
runs-on: macos-latest
env:
CFLAGS: -Werror
PACKAGES: "qt5 eigen pkg-config fftw libpng"
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"
CXX_COMPILER_LAUNCHER: sccache
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: |
brew update || brew update # https://github.com/Homebrew/brew/issues/2491#issuecomment-294207661
brew install $PACKAGES || brew install $PACKAGES
/usr/bin/python3 -m ensurepip && /usr/bin/pip3 install numpy
brew link --force qt5
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: configure
run: ./configure -assert || { cat configure.log; false; }
- name: build
run: ./build -nowarnings -persistent -nopaginate || { cat build.log; false; }
- name: unit tests
run: ./run_tests units || { cat testing_units.log; false; }
- name: binary tests
run: ./run_tests binaries || { cat testing_binaries.log; false; }
- name: check command documentation
run: ./docs/generate_user_docs.sh && git diff --exit-code docs/
windows-build:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
env:
# CFLAGS: -Werror
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@v3
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
release: false
install: |
git
python
${{env.MINGW_PACKAGE_PREFIX}}-bc
${{env.MINGW_PACKAGE_PREFIX}}-diffutils
${{env.MINGW_PACKAGE_PREFIX}}-eigen3
${{env.MINGW_PACKAGE_PREFIX}}-fftw
${{env.MINGW_PACKAGE_PREFIX}}-gcc
${{env.MINGW_PACKAGE_PREFIX}}-libtiff
${{env.MINGW_PACKAGE_PREFIX}}-pkg-config
${{env.MINGW_PACKAGE_PREFIX}}-qt5-base
${{env.MINGW_PACKAGE_PREFIX}}-qt5-svg
${{env.MINGW_PACKAGE_PREFIX}}-zlib
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- 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: |
export CXX_COMPILER_LAUNCHER=${{env.SCCACHE_UNIX_PATH}}
./configure -assert || { cat configure.log; false; }
- name: build
run: ./build -nowarnings -persistent -nopaginate || { cat build.log; false; }
- name: unit tests
run: ./run_tests units || { cat testing_units.log; false; }
- name: binary tests
run: ./run_tests binaries || { cat testing_binaries.log; false; }
secondary-checks:
runs-on: ubuntu-latest
env:
QT_SELECT: qt5
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: |
echo "__version__ = 'pylint testing' #pylint: disable=unused-variable" > ./lib/mrtrix3/_version.py
./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/