Skip to content

Commit 21d54a9

Browse files
authored
Merge pull request #287 from stack-of-tasks/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate
2 parents 5acf4f5 + 86f52d4 commit 21d54a9

File tree

3 files changed

+74
-33
lines changed

3 files changed

+74
-33
lines changed

.github/workflows/ci-linux-osx-conda.yml

Lines changed: 51 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,21 @@ on:
66
- devel
77
- master
88
pull_request:
9-
branches:
10-
- devel
11-
- master
129

1310
jobs:
1411
build-with-conda:
1512
name: '[conda:${{ matrix.os }}:${{ matrix.build_type }}]'
1613
runs-on: ${{ matrix.os }}
14+
env:
15+
CCACHE_BASEDIR: ${GITHUB_WORKSPACE}
16+
CCACHE_DIR: ${GITHUB_WORKSPACE}/.ccache
17+
CCACHE_COMPRESS: true
18+
CCACHE_COMPRESSLEVEL: 5
19+
# Since conda will install a compiler, the compiler mtime will be changed.
20+
# This can invalidate the cache (https://ccache.dev/manual/latest.html#config_compiler_check)
21+
CCACHE_COMPILERCHECK: content
22+
# Help ccache manage generated files and PCH (https://ccache.dev/manual/latest.html#_precompiled_headers)
23+
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,pch_defines,time_macros
1724

1825
strategy:
1926
fail-fast: false
@@ -23,28 +30,30 @@ jobs:
2330

2431
steps:
2532
- uses: actions/checkout@v5
33+
with:
34+
submodules: recursive
2635

27-
- uses: conda-incubator/setup-miniconda@v3
36+
- uses: actions/cache@v4
2837
with:
29-
channels: conda-forge
30-
activate-environment: tsid
38+
path: .ccache
39+
key: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}_${{ github.sha }}
40+
restore-keys: ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}_
3141

32-
- name: Install dependencies [Conda]
33-
shell: bash -l {0}
42+
# Conda compiler is named x86_64-conda-linux-gnu-c++, ccache can't resolve it
43+
# (https://ccache.dev/manual/latest.html#config_compiler_type)
44+
- name: Configure ccache with conda GCC [Conda]
45+
if: contains(matrix.os, 'ubuntu')
3446
run: |
35-
# Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
36-
conda config --remove channels defaults
37-
# Compilation related dependencies
38-
conda install cmake compilers make pkg-config doxygen ninja graphviz
39-
# Main dependencies
40-
conda install tsid --only-deps
41-
conda install proxsuite osqp-eigen
42-
43-
- name: Activate ccache [Conda]
44-
uses: hendrikmuhs/[email protected]
47+
echo "CCACHE_COMPILERTYPE=gcc" >> "$GITHUB_ENV"
48+
49+
- uses: conda-incubator/setup-miniconda@v3
4550
with:
46-
key: ${{ matrix.os }}-${{ matrix.type }}
47-
max-size: 1G
51+
miniforge-version: latest
52+
activate-environment: tsid
53+
environment-file: .github/workflows/conda/environment.yml
54+
auto-activate-base: false
55+
auto-update-conda: true
56+
conda-remove-defaults: true
4857

4958
- name: Print environment [Conda]
5059
shell: bash -l {0}
@@ -53,49 +62,60 @@ jobs:
5362
conda list
5463
env
5564
65+
- name: Clear ccache statistics [Conda]
66+
shell: bash -l {0}
67+
run: |
68+
ccache -z
69+
5670
- name: Configure [Conda]
5771
shell: bash -l {0}
5872
run: |
59-
echo $(whereis ccache)
60-
echo $(which ccache)
61-
git submodule update --init
6273
mkdir build
6374
cd build
64-
cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DINSTALL_DOCUMENTATION:BOOL=ON -DBUILD_WITH_PROXQP:BOOL=ON -DBUILD_WITH_OSQP:BOOL=ON
75+
cmake .. -GNinja\
76+
-DCMAKE_C_COMPILER_LAUNCHER=ccache\
77+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache\
78+
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}\
79+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}\
80+
-DBUILD_PYTHON_INTERFACE:BOOL=ON\
81+
-DPYTHON_EXECUTABLE=$(which python3)\
82+
-DINSTALL_DOCUMENTATION:BOOL=ON\
83+
-DBUILD_WITH_PROXQP:BOOL=ON\
84+
-DBUILD_WITH_OSQP:BOOL=ON
6585
6686
- name: Build [Conda]
6787
shell: bash -l {0}
6888
run: |
6989
cd build
70-
cmake --build . --config ${{ matrix.build_type }} -v
90+
ninja
7191
7292
- name: Build documentation [Conda]
7393
shell: bash -l {0}
7494
run: |
7595
cd build
76-
cmake --build . --config ${{ matrix.build_type }} --target doc
96+
ninja doc
7797
7898
- name: Install [Conda]
7999
shell: bash -l {0}
80100
run: |
81101
cd build
82-
cmake --install . --config ${{ matrix.build_type }}
102+
ninja install
83103
84104
- name: Test [Conda]
85105
shell: bash -l {0}
86106
run: |
87107
find $CONDA_PREFIX -name tsid*
88108
python -c "import tsid"
89109
cd build
90-
ctest --output-on-failure -C ${{ matrix.build_type }}
110+
ctest --output-on-failure
91111
92112
- name: Uninstall [Conda]
93113
shell: bash -l {0}
94114
run: |
95115
cd build
96-
cmake --build . --config ${{ matrix.build_type }} --target uninstall
116+
ninja uninstall
97117
98-
- name: Display ccache statistics [Conda]
118+
- name: Print ccache statistics [Conda]
99119
shell: bash -l {0}
100120
run: |
101-
echo $(ccache -s)
121+
ccache -sv
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: tsid
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- cmake
6+
- cxx-compiler
7+
- pkg-config
8+
- doxygen
9+
- graphviz
10+
- ccache
11+
- ninja
12+
- python
13+
- eigenpy
14+
- libboost-python-devel
15+
- eigen
16+
- pinocchio
17+
- eiquadprog
18+
- osqp-eigen
19+
- proxsuite
20+
- urdfdom
21+
- numpy

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ci:
22
autoupdate_branch: devel
33
repos:
44
- repo: https://github.com/astral-sh/ruff-pre-commit
5-
rev: v0.13.1
5+
rev: v0.14.0
66
hooks:
77
- id: ruff
88
args:
@@ -19,7 +19,7 @@ repos:
1919
hooks:
2020
- id: toml-sort-fix
2121
- repo: https://github.com/pre-commit/mirrors-clang-format
22-
rev: v21.1.1
22+
rev: v21.1.2
2323
hooks:
2424
- id: clang-format
2525
args:

0 commit comments

Comments
 (0)