Skip to content

Commit

Permalink
Merge pull request #2129 from jorisv/topic/fix_ci_ccache
Browse files Browse the repository at this point in the history
Fix ccache
  • Loading branch information
jcarpent authored Jan 12, 2024
2 parents a803a37 + 8a1119e commit 81745db
Show file tree
Hide file tree
Showing 14 changed files with 293 additions and 203 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/conda/environment_macos_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: pinocchio
channels:
- conda-forge
dependencies:
- eigen=3.4.0
- hpp-fcl
- numpy
- boost
- eigenpy
- urdfdom
- python
- cmake
- ccache
- pkg-config
- ninja
- llvm-openmp
- cxx-compiler
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: pinocchio
channels:
- conda-forge
- nodefaults
dependencies:
- eigen=3.4.0
- hpp-fcl
Expand All @@ -10,4 +9,7 @@ dependencies:
- eigenpy
- urdfdom
- python
- mamba
- cmake
- ccache
- pkg-config
- ninja
69 changes: 46 additions & 23 deletions .github/workflows/macos-linux-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@ on: [push,pull_request]

jobs:
pinocchio-conda:
name: Pinocchio on ${{ matrix.os }} in ${{ matrix.build_type }} mode with Conda
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} with Conda
runs-on: ${{ matrix.os }}
env:
CCACHE_DIR: ${{ matrix.CCACHE_DIR }}
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
CCACHE_COMPRESS: true
CCACHE_COMPRESSLEVEL: 6
BUILD_ADVANCED_TESTING: ${{ matrix.BUILD_ADVANCED_TESTING }}

strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
build_type: [Release, Debug]
python-version: ["3.8", "3.12"]

include:
- os: ubuntu-latest
CCACHE_DIR: /home/runner/.ccache
BUILD_ADVANCED_TESTING: OFF
- os: macos-latest
CCACHE_DIR: /Users/runner/.ccache
BUILD_ADVANCED_TESTING: ON

steps:
Expand All @@ -31,40 +33,61 @@ jobs:

- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-conda-${{ matrix.os }}-${{ matrix.build_type }}
path: .ccache
key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-${{ github.sha }}
restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pinocchio
auto-update-conda: true
environment-file: .github/workflows/conda/conda-env.yml
python-version: 3.8
environment-file: .github/workflows/conda/environment_macos_linux.yml
python-version: ${{ matrix.python-version }}
auto-activate-base: false

- name: Install cmake and update conda
shell: bash -l {0}
run: |
conda activate pinocchio
conda install cmake ccache llvm-openmp compilers=1.4.2 -c conda-forge
conda list

- name: Build Pinocchio
shell: bash -l {0}
shell: bash -el {0}
run: |
conda activate pinocchio
conda list
echo $CONDA_PREFIX
mkdir build
cd build
cmake .. -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_WITH_COLLISION_SUPPORT=ON -DBUILD_ADVANCED_TESTING=${{ env.BUILD_ADVANCED_TESTING }} -DBUILD_WITH_CASADI_SUPPORT=OFF -DPYTHON_EXECUTABLE=$(which python3) -DBUILD_WITH_OPENMP_SUPPORT=ON -DINSTALL_DOCUMENTATION=ON -DOpenMP_ROOT=$CONDA_PREFIX
make
make build_tests
CTEST_OUTPUT_ON_FAILURE=1 make test
make install
cmake .. \
-G "Ninja" \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_WITH_COLLISION_SUPPORT=ON \
-DBUILD_ADVANCED_TESTING=${{ env.BUILD_ADVANCED_TESTING }} \
-DBUILD_WITH_CASADI_SUPPORT=OFF \
-DPYTHON_EXECUTABLE=$(which python3) \
-DBUILD_WITH_OPENMP_SUPPORT=ON \
-DINSTALL_DOCUMENTATION=ON \
-DOpenMP_ROOT=$CONDA_PREFIX
cmake --build . -j2
ctest --output-on-failure
cmake --install .
- name: Uninstall Pinocchio
shell: bash -l {0}
shell: bash -el {0}
run: |
cd build
make uninstall
cmake --build . --target uninstall
check:
if: always()
name: check-macos-linux-conda

needs:
- pinocchio-conda

runs-on: Ubuntu-latest

steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
3 changes: 2 additions & 1 deletion .github/workflows/ros-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ jobs:
- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}
key: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.env.ROS_DISTRO }}-${{ matrix.env.ROS_REPO }}-
# Run industrial_ci
- uses: 'ros-industrial/industrial_ci@3ed9846c96ed1e0bb36193e8e250632eaac980d0'
env: ${{ matrix.env }}
75 changes: 0 additions & 75 deletions .github/workflows/windows-conda-clang.yml

This file was deleted.

94 changes: 0 additions & 94 deletions .github/workflows/windows-conda-v142.yml

This file was deleted.

Loading

0 comments on commit 81745db

Please sign in to comment.