Skip to content

Commit

Permalink
create basic Github action (#891)
Browse files Browse the repository at this point in the history
* basic action testing on ubuntu-latest, DEVEL_BUILD=ON/OFF
* add github actions badge and remove Travis badge

fixes #888
  • Loading branch information
KrisThielemans authored Apr 15, 2021
1 parent a491381 commit 843eb25
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
72 changes: 72 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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
Expand Down

0 comments on commit 843eb25

Please sign in to comment.