Skip to content

Update continuous-ubuntu.yml #569

Update continuous-ubuntu.yml

Update continuous-ubuntu.yml #569

name: ubuntu-ci
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CODECOV_TOKEN: 'a6611bcf-89ee-410d-acfa-d4f130b31365'
jobs:
Continuous:
name: ${{ matrix.config }}
# The CMake configure and build commands are platform agnostic and should work equally
# well on Linux, Windows or Mac.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
container:
image: ghcr.io/lihpc-computational-geometry/spack-gmds:latest
strategy:
fail-fast: false
matrix:
config: [Release, Debug]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2 # seems to be needed by codecov
submodules: recursive
- name: Create Build Environment
# We create a subdirectory that will stand as our working directory for all
# subsequent commands
run: >
cmake -E make_directory /build;
cmake -E make_directory /buildinstall;
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: /build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
# CMAKE_INSTALL_PREFIX is specified here because of issue 20565 where CMAKE_INSTALL_LIBDIR
# does not seem to be re-evaluated during the call to cmake --install
run: >
cmake /__w/gmds/gmds -DCMAKE_BUILD_TYPE=${{ matrix.config }}
-DWITH_CODE_COVERAGE=ON
-DWITH_PYTHON_API=OFF
-DENABLE_BLOCKING=ON
-DENABLE_ELGMoRpHING=ON
-DENABLE_KMDS=ON
-DCMAKE_PREFIX_PATH="/spack/opt/spack/lcov;/spack/opt/spack/glpk;/spack/opt/spack/googletest;/spack/opt/spack/py-pybind11;/spack/opt/spack/kokkos;/spack/opt/spack/cgal;/spack/opt/spack/gmp;/spack/opt/spack/mpfr;/spack/opt/spack/boost;/spack/opt/spack/cgns"
-DCMAKE_INSTALL_PREFIX=/buildinstall
-DGLPK_LIB=/spack/opt/spack/glpk/lib
-DGLPK_INC=/spack/opt/spack/glpk/include
- name: Build
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash
working-directory: /build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config ${{ matrix.config }}
- name: C++ Test
working-directory: /build
shell: bash
run: |
if ${{ matrix.config == 'Release'}}; then
ctest -C $BUILD_TYPE
else
export CODACY_PROJECT_TOKEN=6812888e69b348239217c607f514f024
make code_cover_gmds
bash <(curl -s https://codecov.io/bash)
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r code_cover_gmds.info
fi
- name: Install
run: |
if ${{ matrix.config == 'Release'}}; then
cmake --install build --prefix /buildinstall --config Release
else
cmake --install build --prefix /buildinstall --config Debug
fi
- name: C++ Test lib install
run: |
cmake -E make_directory ${{github.workspace}}/user_exe_build
cd ${{github.workspace}}/user_exe_build/
cmake -DCMAKE_PREFIX_PATH="${{github.workspace}}/buildinstall" ${{github.workspace}}/docs/example
make
./examplegmds