-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This resembles what we had in Travis, albeit simpler. We can add more cases if we want to in the future though. Signed-off-by: Rodrigo Tobar <[email protected]>
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build and run tests | ||
on: [push, pull_request] | ||
|
||
env: | ||
CI_BUILD_DIR: build | ||
CMAKE_PREFIX_PATH: 3rdparty/cxxtest | ||
|
||
jobs: | ||
build_and_test: | ||
name: Build and test libprofit. OS=${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
include: | ||
- os: ubuntu-latest | ||
CXX: g++ | ||
omp: true | ||
- os: ubuntu-latest | ||
CXX: g++ | ||
poor_build: true | ||
- os: ubuntu-latest | ||
CXX: clang++ | ||
omp: true | ||
- os: macos-latest | ||
CXX: clang++ | ||
omp: false | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Install system dependencies (Linux) | ||
env: | ||
REQUIRED_DEPS: ninja-build libgsl-dev | ||
OPTIONAL_DEPS: ${{ matrix.poor_build && 'libfftw3-dev opencl-headers' || '' }} | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
run: | | ||
sudo apt install $REQUIRED_DEPS $OPTIONAL_DEPS | ||
- name: Install system dependencies (MacOS) | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: | | ||
brew install ninja gsl fftw | ||
- name: Configure | ||
env: | ||
SHARK_NO_OPENMP: ${{ matrix.omp && 'OFF' || 'ON' }} | ||
CMAKE_EXTRA_FLAGS: ${{ matrix.poor_build && '-DLIBPROFIT_NO_OPENCL=ON -DLIBPROFIT_NO_OPENMP=ON -DLIBPROFIT_NO_FFTW=ON -DLIBPROFIT_NO_SIMD=ON' || '' }} | ||
run: | | ||
cmake -B ${CI_BUILD_DIR} -G Ninja \ | ||
-DSHARK_NO_OPENMP=$SHARK_NO_OPENMP \ | ||
-DSHARK_TEST=ON \ | ||
$CMAKE_EXTRA_FLAGS | ||
- name: Build | ||
run: cmake --build ${CI_BUILD_DIR} | ||
|
||
- name: Run unit tests | ||
run: | | ||
cd ${CI_BUILD_DIR} | ||
ctest --output-on-failure |