From 843eb25760ae8e1e15bc816748d8b80d9c34f7d2 Mon Sep 17 00:00:00 2001 From: Kris Thielemans Date: Thu, 15 Apr 2021 07:56:06 +0100 Subject: [PATCH] create basic Github action (#891) * basic action testing on ubuntu-latest, DEVEL_BUILD=ON/OFF * add github actions badge and remove Travis badge fixes #888 --- .github/workflows/build-test.yml | 72 ++++++++++++++++++++++++++++++++ README.md | 4 +- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-test.yml diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 000000000..2cb369235 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,72 @@ +name: Build-test CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + # the agent machine operating systems + os: [ubuntu-latest] + DEVEL_BUILD: ["OFF", "ON"] + EXTRA_BUILD_FLAGS: ["-DUSE_ITK=ON"] + CMAKE_BUILD_TYPE: ["Release"] + # let's run all of them, as opposed to aborting when one fails + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: install_dependencies + run: + cd ${GITHUB_WORKSPACE}; + git clone https://github.com/CCPPETMR/SIRF-SuperBuild --recursive -b master; + cd SIRF-SuperBuild/docker; + sudo bash raw-ubuntu.sh; + sudo bash build_essential-ubuntu.sh; + sudo bash build_python-ubuntu.sh; + sudo bash build_gadgetron-ubuntu.sh; + sudo bash build_system-ubuntu.sh; + bash user_python-ubuntu.sh ~/virtualenv python3 ; + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ matrix.os }}-${{ matrix.CMAKE_BUILD_TYPE }}-${{ matrix.DEVEL_BUILD }} + - name: configure + shell: bash + env: + EXTRA_BUILD_FLAGS: ${{ matrix.EXTRA_BUILD_FLAGS }} + CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }} + DEVEL_BUILD: "-DDEVEL_BUILD=${{ matrix.DEVEL_BUILD }}" + run: | + set -ex; + export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" + cmake --version + #echo "cmake flags $BUILD_FLAGS $EXTRA_BUILD_FLAGS" + BUILD_FLAGS="-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DUSE_SYSTEM_ACE=ON -DUSE_SYSTEM_Armadillo=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON -DCMAKE_INSTALL_PREFIX=~/install -DPYVER=3"; + BUILD_FLAGS="$BUILD_FLAGS -DSIRF_SOURCE_DIR:PATH=${GITHUB_WORKSPACE} -DDISABLE_GIT_CHECKOUT_SIRF=ON" + # only test SIRF (others are tested in the SIRF-SuperBuild action) + BUILD_FLAGS="$BUILD_FLAGS -DBUILD_TESTING_GADGETRON=OFF -DBUILD_TESTING_ISMRMRD=OFF" + mkdir -p build/; + cd build; + export CC="gcc-7"; + export CXX="g++-7"; + source ~/virtualenv/bin/activate; + cmake -S ../SIRF-SuperBuild ${BUILD_FLAGS} ${EXTRA_BUILD_FLAGS} ${DEVEL_BUILD}; + - name: build + shell: bash + run: + cd ${GITHUB_WORKSPACE}/build; + source ~/virtualenv/bin/activate; + cmake --build . -j 2; + - name: tests + shell: bash + run: | + bash -ev ${GITHUB_WORKSPACE}/SIRF-SuperBuild/docker/ctest_sirf.sh diff --git a/README.md b/README.md index 54221b275..363869475 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Synergistic Image Reconstruction Framework -[![travis-badge]][travis] +[![gh-action-badge]][gh-action-link] [![coveralls-badge]][coveralls] [![codecov-badge]][codecov] [![style-badge]][style-link] [![zenodo-badge]][zenodo-link] @@ -16,6 +16,8 @@ You can also [download a VM](https://doi.org/10.5281/zenodo.2707911) with SIRF a [coveralls]: https://coveralls.io/github/CCPPETMR/SIRF?branch=master [codecov-badge]: https://codecov.io/gh/SyneRBI/SIRF/branch/master/graph/badge.svg [codecov]: https://codecov.io/gh/SyneRBI/SIRF +[gh-action-badge]: https://github.com/SyneRBI/SIRF-SuperBuild/actions/workflows/c-cpp.yml/badge.svg +[gh-action-link]: https://github.com/SyneRBI/SIRF-SuperBuild/actions/workflows/c-cpp.yml/ [travis-badge]: https://travis-ci.org/SyneRBI/SIRF.svg?branch=master [travis]: https://travis-ci.org/SyneRBI/SIRF [style-badge]: https://api.codacy.com/project/badge/Grade/392861b4085f4f438d12c41029f86b47