What about this? #72
Workflow file for this run
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
name: Build And Test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- "*" | |
jobs: | |
build_and_test: | |
strategy: | |
fail-fast: false | |
matrix: | |
BUILD_TYPE: [ Debug ] | |
OS: [ ubuntu-latest, macos-latest ] | |
ARMA_VERSION: [11.2.3] | |
# The CMake configure and build commands are platform-agnostic and should | |
# work equally well on Windows or Mac. You can convert this to a matrix | |
# build if you need cross-platform coverage. See: | |
# https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
name: "${{matrix.BUILD_TYPE}}, ${{matrix.OS}}, Armadillo v${{matrix.ARMA_VERSION}}." | |
runs-on: ${{matrix.OS}} | |
# Skip this action if the commit is just for docs. | |
if: ${{ !contains(github.event.head_commit.message, '#docs') }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Linux dependencies | |
if: startsWith(matrix.OS,'ubuntu') | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y \ | |
cmake \ | |
libopenblas-dev \ | |
liblapack-dev \ | |
libarpack2-dev \ | |
libsuperlu-dev \ | |
wget \ | |
libgsl-dev \ | |
doxygen \ | |
graphviz \ | |
libhdf5-serial-dev | |
- name: Install macOS dependencies | |
if: startsWith(matrix.OS,'macos') | |
run: | | |
brew update | |
brew install --overwrite \ | |
cmake \ | |
doxygen \ | |
graphviz \ | |
wget \ | |
arpack \ | |
hdf5 \ | |
libaec \ | |
openblas \ | |
superlu \ | |
pkg-config \ | |
gsl | |
- name: Download Armadillo from SourceForge | |
run: | | |
mkdir armadillo | |
cd armadillo | |
wget -O armadillo.tar.xz https://sourceforge.net/projects/arma/files/armadillo-${{matrix.ARMA_VERSION}}.tar.xz/download | |
- name: Unzip Armadillo tarball and create build directory | |
working-directory: armadillo | |
run: | | |
tar -xf ./armadillo.tar.xz | |
cd armadillo-${{matrix.ARMA_VERSION}} | |
mkdir build | |
cd build | |
- name: Configure CMake for Armadillo macOS | |
if: startsWith(matrix.OS,'macos') | |
working-directory: armadillo/armadillo-${{matrix.ARMA_VERSION}}/build | |
run: cmake -DALLOW_OPENBLAS_MACOS=ON .. | |
- name: Configure CMake for Armadillo Linux | |
working-directory: armadillo/armadillo-${{matrix.ARMA_VERSION}}/build | |
if: startsWith(matrix.OS,'ubuntu') | |
run: cmake .. | |
- name: Build and Install Armadillo | |
working-directory: armadillo/armadillo-${{matrix.ARMA_VERSION}}/build | |
run: | | |
cmake --build . --target all -j 2 | |
sudo cmake --install . | |
- name: Configure CMake | |
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only | |
# required if you are using a single-configuration generator such as | |
# make. See: | |
# https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} | |
- name: Build the entire project | |
# Build your program with the given configuration | |
run: cmake --build ${{github.workspace}}/build --config ${{matrix.BUILD_TYPE}} --target all -j 2 | |
- name: Run CTest | |
working-directory: ${{github.workspace}}/build | |
# Execute tests defined by the CMake configuration. | |
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail | |
run: ctest -j2 -C ${{matrix.BUILD_TYPE}} --output-on-failure |