Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch CI from miniconda to micromamba and remove homebrew #200

Merged
merged 3 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 10 additions & 47 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ on:
- cron: '0 2 * * *'

env:
vcpkg_robotology_TAG: v0.10.1
YCM_TAG: v0.15.3
YARP_TAG: v3.8.1
iDynTree_TAG: v9.1.0
matioCpp_TAG: v0.2.2
robometry_TAG: v1.2.1
# Overwrite the VCPKG_INSTALLATION_ROOT env variable defined by Github Actions to point to our vcpkg
VCPKG_INSTALLATION_ROOT: C:\robotology\vcpkg

jobs:
build:
Expand All @@ -36,37 +33,22 @@ jobs:
# Clone the repository in $GITHUB_WORKSPACE
- uses: actions/checkout@master

- uses: conda-incubator/setup-miniconda@v2
if: contains(matrix.os, 'windows')
- uses: mamba-org/setup-micromamba@v1
if: matrix.os == 'windows-latest' || matrix.os == 'macOS-latest'
with:
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: wearables
python-version: 3.8
environment-file: ci_env.yml

# Print the environment variables to simplify development and debugging
- name: Environment Variables
# Use bash in order to have same basic commands in all OSs
if: matrix.os == 'ubuntu-latest'
# Use bash in order to have same basic commands in all OSs
shell: bash
run: env

# Remove apt repos on Ubuntu that are known to break from time to time
# See https://github.com/actions/virtual-environments/issues/323
- name: Remove broken apt repos [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
for apt_file in `grep -lr microsoft /etc/apt/sources.list.d/`; do sudo rm $apt_file; done

# ============
# DEPENDENCIES
# ============

- name: Dependencies [macOS]
if: matrix.os == 'macOS-latest'
run: |
brew install ccache eigen ace tinyxml gsl boost libmatio pybind11

- name: Dependencies [Ubuntu]
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -75,18 +57,9 @@ jobs:
libboost-thread-dev liborocos-kdl-dev libeigen3-dev swig qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev libqt5charts5-dev \
libxml2-dev liburdfdom-dev libtinyxml-dev liburdfdom-dev liboctave-dev python3-dev python3-pybind11 valgrind libassimp-dev libmatio-dev

- name: Cache Source-based dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macOS'))
id: cache-source-deps
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/install/deps
# Including ${{ runner.temp }} is a workaround for https://github.com/robotology/whole-body-estimators/issues/60
key: source-deps-${{runner.os}}-${{runner.temp}}-vcpkg-robotology-${{env.vcpkg_robotology_TAG}}-ycm-${{env.YCM_TAG}}-yarp-${{env.YARP_TAG}}-iDynTree-${{env.iDynTree_TAG}}-matioCpp-${{env.matioCpp_TAG}}-robometry-${{env.robometry_TAG}}


- name: Source-based Dependencies [Ubuntu/macOS]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest')
- name: Source-based Dependencies [Ubuntu]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && (matrix.os == 'ubuntu-latest')
shell: bash
run: |
# YCM
Expand Down Expand Up @@ -142,15 +115,6 @@ jobs:
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install/deps ..
cmake --build . --config ${{matrix.build_type}} --target install

- name: Dependencies (using conda) [Windows]
if: steps.cache-source-deps.outputs.cache-hit != 'true' && contains(matrix.os, 'windows')
shell: bash -l {0}
run: |
# Compilation related dependencies
mamba install cmake compilers make ninja pkg-config
# Actual dependencies
mamba install -c robotology yarp idyntree matio-cpp robometry

# ===================
# CMAKE-BASED PROJECT
# ===================
Expand All @@ -164,15 +128,17 @@ jobs:
cd build
cmake -G"Visual Studio 17 2022" -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_BUILD_TPYE=${{matrix.build_type}} \
-DWEARABLES_COMPILE_PYTHON_BINDINGS=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..

- name: Configure [Ubuntu/macOS]
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
shell: bash
shell: bash -l {0}
run: |
mkdir -p build
cd build
cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps \
-DCMAKE_BUILD_TPYE=${{matrix.build_type}} \
-DWEARABLES_COMPILE_PYTHON_BINDINGS=ON \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..

Expand All @@ -181,7 +147,4 @@ jobs:
shell: bash
run: |
cd build
# Attempt of fix for using YARP idl generators (that link ACE) in Windows
# See https://github.com/robotology/idyntree/issues/569
export PATH=$PATH:${GITHUB_WORKSPACE}/install/bin:${VCPKG_INSTALLATION_ROOT}/install/x64-windows/bin:${VCPKG_INSTALLATION_ROOT}/installed/x64-windows/debug/bin
cmake --build . --config ${{matrix.build_type}}
15 changes: 15 additions & 0 deletions ci_env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: wearables
channels:
- conda-forge
- robotology
dependencies:
- cmake
- compilers
- make
- ninja
- pkg-config
- pybind11
- yarp
- idyntree
- matio-cpp
- robometry