Skip to content

Commit

Permalink
ci: Fix ccache
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisv committed Jan 9, 2024
1 parent d1c3e6c commit d3f7e16
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 51 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/conda/environment_macos_linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: eigenpy
channels:
- conda-forge
dependencies:
- eigen
- cmake
- numpy
- pkg-config
- boost
- cmake
- ccache
- cxx-compiler
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: eigenpy
channels:
- conda-forge
- defaults
dependencies:
- eigen
- cmake
Expand Down
62 changes: 29 additions & 33 deletions .github/workflows/macos-linux-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ jobs:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} ${{ matrix.cxx_options }}
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

strategy:
fail-fast: false
Expand All @@ -17,12 +20,6 @@ jobs:
build_type: [Release, Debug]
python-version: ["3.8", "3.12"]

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

exclude:
- build_type: Debug
cxx_options: -mavx2
Expand All @@ -32,68 +29,67 @@ jobs:
os: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive

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

- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}

- name: Prepare cache dir
run: sudo mkdir -p ${CCACHE_DIR}/tmp && sudo chown -R $(id -un) ${CCACHE_DIR}

- name: Install cmake and update conda
shell: bash -l {0}
run: |
conda activate eigenpy
conda install cmake ccache -c conda-forge
conda list
path: .ccache
key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ github.sha }}
restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-

- name: Build EigenPy
shell: bash -l {0}
shell: bash -el {0}
run: |
conda activate eigenpy
conda list
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 }}
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
- name: Test packaging
shell: bash -l {0}
shell: bash -el {0}
run: |
conda activate eigenpy
cmake -B test-packaging -S unittest/packaging/cmake -DPYTHON_EXECUTABLE=$(which python3)
cmake -B test-packaging \
-S unittest/packaging/cmake \
-DPYTHON_EXECUTABLE=$(which python3)
- name: Configure hpp-fcl
shell: bash -l {0}
shell: bash -el {0}
run: |
conda activate eigenpy
conda install -c conda-forge octomap assimp qhull
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)
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE=$(which python3)
- name: Uninstall EigenPy
shell: bash -l {0}
shell: bash -el {0}
run: |
cd build
make uninstall
Expand Down
41 changes: 24 additions & 17 deletions .github/workflows/windows-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,49 @@ on: [push,pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
env:
ccache_basedir: "${github_workspace}"
ccache_dir: "${github_workspace}/.ccache"
ccache_compress: true
ccache_compresslevel: 6

strategy:
fail-fast: false
matrix:
os: [windows-latest]

steps:
- uses: actions/checkout@v3
- name: Checkout submodules
run: |
git submodule update --init
- uses: goanpeca/setup-miniconda@v1
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: eigenpy
environment-file: .github/workflows/conda/environment.yml
auto-update-conda: true
environment-file: .github/workflows/conda/environment_windows.yml
python-version: "3.10"
auto-activate-base: false

- uses: actions/cache@v3
with:
path: .ccache
key: ccache-windows-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ github.sha }}
restore-keys: ccache-windows-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-

- name: Build Eigenpy
shell: cmd /C CALL {0}
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
run: |
:: unset extra Boost envs
set Boost_ROOT=
set BOOST_ROOT_1_69_0=
set BOOST_ROOT_1_72_0=
set PATH=%PATH:C:\hostedtoolcache\windows\Boost\1.72.0;=%
if errorlevel 1 exit 1
:: start building
call "%programfiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
if errorlevel 1 exit 1
mkdir build
pushd build
cmake ^
-G "NMake Makefiles" ^
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^
-DCMAKE_BUILD_TYPE=Release ^
-DGENERATE_PYTHON_STUBS=ON ^
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
Expand Down

0 comments on commit d3f7e16

Please sign in to comment.