Skip to content

Add compiler caching support for CI checks #1374

Add compiler caching support for CI checks

Add compiler caching support for CI checks #1374

Workflow file for this run

name: checks
on:
pull_request:
types: [opened, synchronize]
branches:
- master
- dev
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
- 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: Run sccache-stats
run: sccache --show-stats
- 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; }
- name: Run sccache-stats
run: sccache --show-stats
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
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: Run sccache-stats
run: sccache --show-stats
- 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"
steps:
- uses: actions/checkout@v3
with:
ref: dev
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
install: |
git
python
${{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: configure
run: |
export CXX_COMPILER_LAUNCHER=$SCCACHE_PATH
./configure -assert || { cat configure.log; false; }
- name: build
run: ./build -nowarnings -persistent -nopaginate || { cat build.log; false; }
- name: Run sccache-stats
run: $SCCACHE_PATH --show-stats
- 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/