@@ -28,11 +28,11 @@ concurrency:
2828jobs :
2929 build :
3030
31- runs-on : ${{ matrix.os }}
32-
31+ runs-on : ubuntu-latest
32+ container : ${{ matrix.container }}
3333 strategy :
3434 matrix :
35- os : [ubuntu- 22.04, ubuntu-20 .04]
35+ container : [' ubuntu:20.04', 'ubuntu: 22.04', ' ubuntu:24 .04' ]
3636
3737 env :
3838 CCACHE_BASEDIR : ${GITHUB_WORKSPACE}
4141 CCACHE_COMPRESSLEVEL : 5
4242
4343 steps :
44+ - name : Setup Container
45+ run : |
46+ apt update && DEBIAN_FRONTEND="noninteractive" apt install -y sudo lsb-release gnupg2 cmake git python3
4447 - uses : actions/checkout@v4
4548 with :
4649 fetch-depth : 0
5154 with :
5255 path : .ccache
5356 save-always : true
54- key : ccache-linux-${{ matrix.os }}-${{ github.sha }}
55- restore-keys : ccache-linux-${{ matrix.os }}-
57+ key : ccache-linux-${{ matrix.container }}-${{ github.sha }}
58+ restore-keys : ccache-linux-${{ matrix.container }}-
5659
5760 # extract branch name
5861 - name : Get branch name (merge)
@@ -72,11 +75,11 @@ jobs:
7275
7376 - name : Register robotpkg
7477 run : |
75- sudo sh -c "echo \"deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg\" >> /etc/apt/sources.list "
76- sudo apt-key adv --fetch-keys http://robotpkg.openrobots.org/packages/debian/robotpkg.key
78+ sh -c "echo \"deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg\" >> /etc/apt/sources.list "
79+ apt-key adv --fetch-keys http://robotpkg.openrobots.org/packages/debian/robotpkg.key
7780 - name : Set and install dependencies
7881 run : |
79- sudo rm -rf /usr/local/share/boost/1.69.0
82+ rm -rf /usr/local/share/boost/1.69.0
8083 export PYTHON3_VERSION=$(python3 -c "import sys; print(str(sys.version_info.major)+str(sys.version_info.minor))")
8184 export APT_DEPENDENCIES="doxygen \
8285 ccache \
@@ -98,14 +101,17 @@ jobs:
98101 robotpkg-py${PYTHON3_VERSION}-hpp-fcl \
99102 robotpkg-py${PYTHON3_VERSION}-casadi"
100103 echo $APT_DEPENDENCIES
101- sudo apt-get update -qq
102- sudo apt-get install -qq ${APT_DEPENDENCIES}
104+
105+ apt-get update -qq
106+ DEBIAN_FRONTEND="noninteractive" apt-get install -qq ${APT_DEPENDENCIES}
103107 - name : Free disk space
104108 run : |
105- sudo apt clean
109+ apt clean
106110 df -h
107111 - name : Run cmake
108112 run : |
113+ # Add cloned repo to safe.directory, since it was not cloned by the container
114+ git config --global --add safe.directory "$GITHUB_WORKSPACE"
109115 git submodule update --init
110116 export PATH=$PATH:/opt/openrobots/bin
111117 export PYTHON3_DOT_VERSION=$(python3 -c "import sys; print(str(sys.version_info.major)+'.'+str(sys.version_info.minor))")
@@ -139,12 +145,15 @@ jobs:
139145 mkdir build
140146 cd build
141147 export CMAKE_PREFIX_PATH=/usr/local
148+ # Test CMake module packaging
142149 cmake .. \
143150 -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
144151 -DPYTHON_EXECUTABLE=$(which python3)
145152 make -j2
146153 ./run_rnea
147154 ./load_urdf
155+
156+ # Test pkg-config packaging
148157 cd ../../pkgconfig
149158 mkdir build
150159 cd build
@@ -153,6 +162,9 @@ jobs:
153162 -DPYTHON_EXECUTABLE=$(which python3)
154163 make -j2
155164 ./run_rnea
165+ ./load_urdf
166+
167+ # Test FetchContent packaging
156168 cd ../../external
157169 export PINOCCHIO_GIT_REPOSITORY="file://"$GITHUB_WORKSPACE
158170 #export PINOCCHIO_GIT_REPOSITORY=$(git remote get-url origin)
@@ -166,6 +178,8 @@ jobs:
166178 make -j2
167179 ./run_rnea
168180 ./load_urdf
181+
182+ # Test CMake module packaging and pinocchio_header target
169183 cd ../../pinocchio_header
170184 mkdir build
171185 cd build
@@ -180,3 +194,18 @@ jobs:
180194 run : |
181195 cd build
182196 sudo make uninstall
197+
198+ check :
199+ if : always()
200+ name : check-linux-apt
201+
202+ needs :
203+ - build
204+
205+ runs-on : Ubuntu-latest
206+
207+ steps :
208+ - name : Decide whether the needed jobs succeeded or failed
209+ uses : re-actors/alls-green@release/v1
210+ with :
211+ jobs : ${{ toJSON(needs) }}
0 commit comments