Skip to content

Commit d3f7e16

Browse files
committed
ci: Fix ccache
1 parent d1c3e6c commit d3f7e16

File tree

4 files changed

+65
-51
lines changed

4 files changed

+65
-51
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+
- cmake
11+
- ccache
12+
- cxx-compiler

.github/workflows/conda/environment.yml renamed to .github/workflows/conda/environment_windows.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: eigenpy
22
channels:
33
- conda-forge
4-
- defaults
54
dependencies:
65
- eigen
76
- cmake

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

Lines changed: 29 additions & 33 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,68 +29,67 @@ 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: conda-incubator/setup-miniconda@v3
4037
with:
4138
activate-environment: eigenpy
4239
auto-update-conda: true
43-
environment-file: .github/workflows/conda/environment.yml
40+
environment-file: .github/workflows/conda/environment_macos_linux.yml
4441
python-version: ${{ matrix.python-version }}
42+
auto-activate-base: false
4543

4644
- uses: actions/cache@v3
4745
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
46+
path: .ccache
47+
key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-${{ github.sha }}
48+
restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-
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 }}
59+
cmake .. \
60+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
61+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
62+
-DPYTHON_EXECUTABLE=$(which python3) \
63+
-DGENERATE_PYTHON_STUBS=ON \
64+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
65+
-DCMAKE_CXX_FLAGS=${{ matrix.cxx_options }}
7166
make
7267
make build_tests
7368
export CTEST_OUTPUT_ON_FAILURE=1
7469
make test
7570
make install
7671
7772
- name: Test packaging
78-
shell: bash -l {0}
73+
shell: bash -el {0}
7974
run: |
80-
conda activate eigenpy
81-
82-
cmake -B test-packaging -S unittest/packaging/cmake -DPYTHON_EXECUTABLE=$(which python3)
75+
cmake -B test-packaging \
76+
-S unittest/packaging/cmake \
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 .. -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
88+
-DCMAKE_BUILD_TYPE=Release \
89+
-DPYTHON_EXECUTABLE=$(which python3)
9490
9591
- name: Uninstall EigenPy
96-
shell: bash -l {0}
92+
shell: bash -el {0}
9793
run: |
9894
cd build
9995
make uninstall

.github/workflows/windows-conda.yml

Lines changed: 24 additions & 17 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 }}-${{ github.sha }}
35+
restore-keys: ccache-windows-conda-${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.cxx_options }}-
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 ^
4147
-G "NMake Makefiles" ^
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 ^

0 commit comments

Comments
 (0)