Skip to content
Snippets Groups Projects
macos-linux-conda.yml 2.44 KiB
Newer Older
Justin Carpentier's avatar
Justin Carpentier committed
name: Conda-CI

on: [push,pull_request]

jobs:
  eigenpy-conda:
Justin Carpentier's avatar
Justin Carpentier committed
    name: ${{ matrix.os }} - ${{ matrix.build_type }} ${{ matrix.cxx_options }}
    runs-on: ${{ matrix.os }}
Justin Carpentier's avatar
Justin Carpentier committed
    env:
      CCACHE_DIR: .ccache # Enable ccache

    strategy:
      fail-fast: false
      matrix:
        os: ["ubuntu-latest", "macos-latest"]
Justin Carpentier's avatar
Justin Carpentier committed
        cxx_options: ['', '-mavx2']
        build_type: [Release, Debug]

        exclude:
          - build_type: Debug
            cxx_options: -mavx2
            os: macos-latest
          - build_type: Release
            cxx_options: -mavx2
            os: macos-latest

    - uses: actions/checkout@v3
Justin Carpentier's avatar
Justin Carpentier committed
      with:
        submodules: recursive

    - uses: conda-incubator/setup-miniconda@v2
      with:
        activate-environment: eigenpy
        auto-update-conda: true
        environment-file: .github/workflows/conda/environment.yml
        python-version: '3.10'
    - uses: actions/cache@v3
Justin Carpentier's avatar
Justin Carpentier committed
      with:
        path: ${{ env.CCACHE_DIR }}
Justin Carpentier's avatar
Justin Carpentier committed
        key: ccache-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}
Justin Carpentier's avatar
Justin Carpentier committed

    - name: Install cmake and update conda
      shell: bash -l {0}
      run: |
        conda activate eigenpy
        conda install cmake ccache -c conda-forge
    - name: Build EigenPy
      shell: bash -l {0}
      run: |
        conda activate eigenpy
        echo $CONDA_PREFIX
        mkdir build
        cd build

        cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DPYTHON_EXECUTABLE=$(which python3) -DGENERATE_PYTHON_STUBS=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS=${{ matrix.cxx_options }}
        make
        make build_tests
        export CTEST_OUTPUT_ON_FAILURE=1
        make test
        make install

Guilhem Saurel's avatar
Guilhem Saurel committed
    - name: Test packaging
      shell: bash -l {0}
      run: |
        conda activate eigenpy

        cmake -B test-packaging -S unittest/packaging/cmake -DPYTHON_EXECUTABLE=$(which python3)

    - name: Configure hpp-fcl
Justin Carpentier's avatar
Justin Carpentier committed
      shell: bash -l {0}
      run: |
        conda activate eigenpy
        conda install -c conda-forge octomap assimp qhull
Justin Carpentier's avatar
Justin Carpentier committed
        git clone https://github.com/humanoid-path-planner/hpp-fcl.git --recursive
        cd hpp-fcl
        mkdir build && cd build
        cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(which python3)
    - name: Uninstall EigenPy
      shell: bash -l {0}
      run: |
        cd build
        make uninstall