Skip to content

Commit f01464e

Browse files
authored
Merge pull request #422 from jorisv/topic/fix_ci_ccache
Fix ccache
2 parents d1c3e6c + e97c921 commit f01464e

File tree

4 files changed

+81
-63
lines changed

4 files changed

+81
-63
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: eigenpy
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- eigen
6+
- cmake
7+
- numpy
8+
- pkg-config
9+
- boost
10+
- ccache
11+
- cxx-compiler
12+
- ninja
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name: eigenpy
22
channels:
33
- conda-forge
4-
- defaults
54
dependencies:
65
- eigen
76
- cmake
87
- numpy
98
- pkg-config
109
- boost
10+
- ccache
11+
- ninja

.github/workflows/macos-linux-conda.yml

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ jobs:
77
name: ${{ matrix.os }} - Python ${{ matrix.python-version }} ${{ matrix.build_type }} ${{ matrix.cxx_options }}
88
runs-on: ${{ matrix.os }}
99
env:
10-
CCACHE_DIR: ${{ matrix.CCACHE_DIR }}
10+
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
11+
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
12+
CCACHE_COMPRESS: true
13+
CCACHE_COMPRESSLEVEL: 6
1114

1215
strategy:
1316
fail-fast: false
@@ -17,12 +20,6 @@ jobs:
1720
build_type: [Release, Debug]
1821
python-version: ["3.8", "3.12"]
1922

20-
include:
21-
- os: ubuntu-latest
22-
CCACHE_DIR: /home/runner/.ccache
23-
- os: macos-latest
24-
CCACHE_DIR: /Users/runner/.ccache
25-
2623
exclude:
2724
- build_type: Debug
2825
cxx_options: -mavx2
@@ -32,71 +29,72 @@ jobs:
3229
os: macos-latest
3330

3431
steps:
35-
- uses: actions/checkout@v3
32+
- uses: actions/checkout@v4
3633
with:
3734
submodules: recursive
3835

39-
- uses: conda-incubator/setup-miniconda@v2
36+
- uses: actions/cache@v3
37+
with:
38+
path: .ccache
39+
key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ matrix.python-version }}-${{ github.sha }}
40+
restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.python-version }}-${{ matrix.cxx_options }}-${{ matrix.python-version }}-
41+
42+
- uses: conda-incubator/setup-miniconda@v3
4043
with:
4144
activate-environment: eigenpy
4245
auto-update-conda: true
43-
environment-file: .github/workflows/conda/environment.yml
46+
environment-file: .github/workflows/conda/environment_macos_linux.yml
4447
python-version: ${{ matrix.python-version }}
45-
46-
- uses: actions/cache@v3
47-
with:
48-
path: ${{ env.CCACHE_DIR }}
49-
key: ccache-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}
50-
51-
- name: Prepare cache dir
52-
run: sudo mkdir -p ${CCACHE_DIR}/tmp && sudo chown -R $(id -un) ${CCACHE_DIR}
53-
54-
- name: Install cmake and update conda
55-
shell: bash -l {0}
56-
run: |
57-
conda activate eigenpy
58-
conda install cmake ccache -c conda-forge
59-
conda list
48+
auto-activate-base: false
6049

6150
- name: Build EigenPy
62-
shell: bash -l {0}
51+
shell: bash -el {0}
6352
run: |
64-
conda activate eigenpy
53+
conda list
6554
echo $CONDA_PREFIX
6655
6756
mkdir build
6857
cd build
6958
70-
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 }}
71-
make
72-
make build_tests
73-
export CTEST_OUTPUT_ON_FAILURE=1
74-
make test
75-
make install
59+
cmake .. \
60+
-G "Ninja" \
61+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
62+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
63+
-DPYTHON_EXECUTABLE=$(which python3) \
64+
-DGENERATE_PYTHON_STUBS=ON \
65+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
66+
-DCMAKE_CXX_FLAGS=${{ matrix.cxx_options }}
67+
cmake --build . -j2
68+
ctest --output-on-failure
69+
cmake --install .
7670
7771
- name: Test packaging
78-
shell: bash -l {0}
72+
shell: bash -el {0}
7973
run: |
80-
conda activate eigenpy
81-
82-
cmake -B test-packaging -S unittest/packaging/cmake -DPYTHON_EXECUTABLE=$(which python3)
74+
cmake -B test-packaging \
75+
-S unittest/packaging/cmake \
76+
-G "Ninja" \
77+
-DPYTHON_EXECUTABLE=$(which python3)
8378
8479
- name: Configure hpp-fcl
85-
shell: bash -l {0}
80+
shell: bash -el {0}
8681
run: |
87-
conda activate eigenpy
8882
conda install -c conda-forge octomap assimp qhull
8983
9084
git clone https://github.com/humanoid-path-planner/hpp-fcl.git --recursive
9185
cd hpp-fcl
9286
mkdir build && cd build
93-
cmake .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(which python3)
87+
cmake .. \
88+
-G "Ninja" \
89+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
90+
-DCMAKE_BUILD_TYPE=Release \
91+
-DPYTHON_EXECUTABLE=$(which python3)
9492
9593
- name: Uninstall EigenPy
96-
shell: bash -l {0}
94+
shell: bash -el {0}
9795
run: |
9896
cd build
99-
make uninstall
97+
cmake --build . --target uninstall
10098
10199
102100
check:

.github/workflows/windows-conda.yml

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,49 @@ on: [push,pull_request]
44
jobs:
55
build:
66
runs-on: ${{ matrix.os }}
7+
env:
8+
CCACHE_BASEDIR: "${GITHUB_WORKSPACE}"
9+
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache"
10+
CCACHE_COMPRESS: true
11+
CCACHE_COMPRESSLEVEL: 6
12+
713
strategy:
814
fail-fast: false
915
matrix:
1016
os: [windows-latest]
17+
1118
steps:
12-
- uses: actions/checkout@v3
13-
- name: Checkout submodules
14-
run: |
15-
git submodule update --init
16-
- uses: goanpeca/setup-miniconda@v1
17-
env:
18-
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- uses: conda-incubator/setup-miniconda@v3
1924
with:
2025
activate-environment: eigenpy
21-
environment-file: .github/workflows/conda/environment.yml
26+
auto-update-conda: true
27+
environment-file: .github/workflows/conda/environment_windows.yml
2228
python-version: "3.10"
29+
auto-activate-base: false
30+
31+
- uses: actions/cache@v3
32+
with:
33+
path: .ccache
34+
key: ccache-windows-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ matrix.python-version }}-${{ github.sha }}
35+
restore-keys: ccache-windows-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ matrix.python-version }}-
36+
2337
- name: Build Eigenpy
2438
shell: cmd /C CALL {0}
25-
env:
26-
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
2739
run: |
28-
:: unset extra Boost envs
29-
set Boost_ROOT=
30-
set BOOST_ROOT_1_69_0=
31-
set BOOST_ROOT_1_72_0=
32-
set PATH=%PATH:C:\hostedtoolcache\windows\Boost\1.72.0;=%
33-
if errorlevel 1 exit 1
34-
3540
:: start building
3641
call "%programfiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64
3742
if errorlevel 1 exit 1
43+
3844
mkdir build
3945
pushd build
4046
cmake ^
41-
-G "NMake Makefiles" ^
47+
-G "Ninja" ^
4248
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
49+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache ^
4350
-DCMAKE_BUILD_TYPE=Release ^
4451
-DGENERATE_PYTHON_STUBS=ON ^
4552
-DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^
@@ -63,7 +70,7 @@ jobs:
6370
:: Test packaging
6471
6572
cmake -B test-packaging -S unittest/packaging/cmake ^
66-
-G "NMake Makefiles" ^
73+
-G "Ninja" ^
6774
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe
6875
if errorlevel 1 exit 1
6976
@@ -74,7 +81,7 @@ jobs:
7481
mkdir build
7582
pushd build
7683
cmake ^
77-
-G "NMake Makefiles" ^
84+
-G "Ninja" ^
7885
-DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^
7986
-DCMAKE_BUILD_TYPE=Release ^
8087
-DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^

0 commit comments

Comments
 (0)