Skip to content

Commit c2f8621

Browse files
committed
Update CI workflow
1 parent 3f3d2c2 commit c2f8621

File tree

1 file changed

+186
-104
lines changed

1 file changed

+186
-104
lines changed

.github/workflows/ci.yml

+186-104
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,27 @@ on:
66
pull_request:
77
branches:
88
- master
9+
workflow_dispatch:
910
jobs:
10-
build:
11+
build-macos:
1112
name: Build
1213
runs-on: ${{ matrix.os }}
1314
strategy:
1415
fail-fast: false
1516
matrix:
16-
name:
17-
- macos-11
18-
- ubuntu-20.04-clang
19-
- ubuntu-20.04-gcc
20-
- windows-2019-msvc
21-
- windows-2019-msys2
22-
include:
23-
- name: macos-11
24-
cmake_compiler_launcher: ccache
25-
cmake_prefix_path: /usr/local/opt/qt/lib/cmake
26-
os: macos-11
27-
- name: ubuntu-20.04-clang
28-
cc: clang
29-
cmake_compiler_launcher: ccache
30-
cxx: clang++
31-
os: ubuntu-20.04
32-
- name: ubuntu-20.04-gcc
33-
cc: gcc
34-
cmake_compiler_launcher: ccache
35-
cxx: g++
36-
os: ubuntu-20.04
37-
- name: windows-2019-msvc
38-
os: windows-2019
39-
- name: windows-2019-msys2
40-
cmake_compiler_launcher: ccache
41-
os: windows-2019
17+
os:
18+
- macos-12
4219
env:
43-
CC: ${{ matrix.cc }}
4420
CCACHE_COMPRESS: true
4521
CCACHE_MAXSIZE: 500M
46-
CMAKE_C_COMPILER_LAUNCHER: ${{ matrix.cmake_compiler_launcher }}
47-
CMAKE_CXX_COMPILER_LAUNCHER: ${{ matrix.cmake_compiler_launcher }}
48-
CMAKE_PREFIX_PATH: ${{ matrix.cmake_prefix_path }}
49-
CXX: ${{ matrix.cxx }}
22+
CMAKE_C_COMPILER_LAUNCHER: ccache
23+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
5024
steps:
5125
- name: Checkout repository
52-
uses: actions/checkout@v3
53-
- if: matrix.os == 'macos-11'
54-
name: Set up Tap
26+
uses: actions/checkout@v4
27+
- name: Set up Tap
5528
run: brew tap roboticslibrary/rl
56-
- if: matrix.os == 'ubuntu-20.04'
57-
name: Set up PPA
58-
run: |
59-
sudo apt-get install -y software-properties-common
60-
sudo apt-add-repository -y -u ppa:roblib/ppa
61-
- if: matrix.os == 'macos-11'
62-
name: Install dependencies for macOS
29+
- name: Install dependencies
6330
run: >
6431
brew install
6532
boost
@@ -73,11 +40,174 @@ jobs:
7340
nlopt
7441
ode
7542
pqp
76-
qt
7743
solid
7844
soqt
79-
- if: matrix.os == 'ubuntu-20.04'
80-
name: Install dependencies for Ubuntu
45+
- name: Update environment variables
46+
run: |
47+
echo "CCACHE_BASEDIR=${{ runner.workspace }}" >> $GITHUB_ENV
48+
echo "CCACHE_DIR=${{ runner.workspace }}/.ccache" >> $GITHUB_ENV
49+
- name: Cache compiler
50+
uses: actions/cache@v3
51+
with:
52+
path: ${{ runner.workspace }}/.ccache
53+
key: ${{ matrix.os }}-ccache-${{ github.sha }}
54+
restore-keys: ${{ matrix.os }}-ccache-
55+
- name: Configure CMake
56+
run: cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S"${{ github.workspace }}" -B"${{ runner.workspace }}/rl-build"
57+
- name: Build
58+
working-directory: ${{ runner.workspace }}/rl-build
59+
run: cmake --build .
60+
- name: Test
61+
working-directory: ${{ runner.workspace }}/rl-build
62+
run: ctest --output-on-failure
63+
- name: Create archive
64+
working-directory: ${{ runner.workspace }}/rl-build
65+
run: cpack -G TXZ
66+
- name: Upload archive
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: ${{ matrix.os }}
70+
path: ${{ runner.workspace }}/rl-build/rl-*.tar.xz
71+
build-msvc:
72+
name: Build
73+
runs-on: ${{ matrix.os }}
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
os:
78+
- windows-2019
79+
- windows-2022
80+
qt:
81+
- qt5
82+
- qt6
83+
include:
84+
- os: windows-2019
85+
toolchain: 14.2
86+
- os: windows-2022
87+
toolchain: 14.3
88+
steps:
89+
- name: Checkout repository
90+
uses: actions/checkout@v4
91+
- name: Enable Developer Command Prompt
92+
uses: ilammy/msvc-dev-cmd@v1
93+
- name: Install dependencies
94+
working-directory: ${{ runner.workspace }}
95+
run: |
96+
curl -L https://github.com/roboticslibrary/rl-3rdparty/releases/download/latest/rl-3rdparty-msvc-${{ matrix.toolchain }}-x64-${{ matrix.qt }}.7z -o rl-3rdparty.7z
97+
7z x rl-3rdparty.7z -orl-3rdparty-install
98+
Write-Output "${{ runner.workspace }}\rl-3rdparty-install\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
99+
- name: Configure CMake
100+
run: cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S"${{ github.workspace }}" -B"${{ runner.workspace }}/rl-build"
101+
- name: Build
102+
working-directory: ${{ runner.workspace }}/rl-build
103+
run: cmake --build .
104+
- name: Test
105+
working-directory: ${{ runner.workspace }}/rl-build
106+
run: ctest --output-on-failure
107+
- name: Create archive
108+
working-directory: ${{ runner.workspace }}/rl-build
109+
run: cpack -G 7Z
110+
- name: Upload archive
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: ${{ matrix.os }}-msvc-${{ matrix.toolchain }}-${{ matrix.qt }}
114+
path: ${{ runner.workspace }}/rl-build/rl-*.7z
115+
build-msys2:
116+
name: Build
117+
runs-on: ${{ matrix.os }}
118+
strategy:
119+
fail-fast: false
120+
matrix:
121+
os:
122+
- windows-2022
123+
sys:
124+
- ucrt64
125+
env:
126+
CCACHE_COMPRESS: true
127+
CCACHE_MAXSIZE: 500M
128+
CMAKE_C_COMPILER_LAUNCHER: ccache
129+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
130+
defaults:
131+
run:
132+
shell: msys2 {0}
133+
steps:
134+
- name: Checkout repository
135+
uses: actions/checkout@v4
136+
- name: Set up MSYS2
137+
uses: msys2/setup-msys2@v2
138+
with:
139+
msystem: ${{matrix.sys}}
140+
pacboy: >-
141+
boost:p
142+
bullet:p
143+
ccache:p
144+
cmake:p
145+
coin:p
146+
eigen3:p
147+
libxml2:p
148+
libxslt:p
149+
ninja:p
150+
nlopt:p
151+
ode:p
152+
pqp:p
153+
solid3:p
154+
soqt:p
155+
toolchain:p
156+
update: true
157+
- name: Update environment variables
158+
run: |
159+
echo "CCACHE_BASEDIR=${{ runner.workspace }}" >> $GITHUB_ENV
160+
echo "CCACHE_DIR=${{ runner.workspace }}/.ccache" >> $GITHUB_ENV
161+
- name: Cache compiler
162+
uses: actions/cache@v3
163+
with:
164+
path: ${{ runner.workspace }}/.ccache
165+
key: ${{ matrix.os }}-msys2-${{ matrix.sys }}-ccache-${{ github.sha }}
166+
restore-keys: ${{ matrix.os }}-msys2-${{ matrix.sys }}-ccache-
167+
- name: Configure CMake
168+
run: cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S"${{ github.workspace }}" -B"${{ runner.workspace }}/rl-build"
169+
- name: Build
170+
working-directory: ${{ runner.workspace }}/rl-build
171+
run: cmake --build .
172+
- name: Test
173+
working-directory: ${{ runner.workspace }}/rl-build
174+
run: ctest --output-on-failure
175+
- name: Create archive
176+
working-directory: ${{ runner.workspace }}/rl-build
177+
run: cpack -G TXZ
178+
- name: Upload archive
179+
uses: actions/upload-artifact@v4
180+
with:
181+
name: ${{ matrix.os }}-msys2-${{ matrix.sys }}
182+
path: ${{ runner.workspace }}/rl-build/rl-*.tar.xz
183+
build-ubuntu:
184+
name: Build
185+
runs-on: ${{ matrix.os }}
186+
strategy:
187+
fail-fast: false
188+
matrix:
189+
os:
190+
- ubuntu-22.04
191+
compiler:
192+
- cc: clang
193+
cxx: clang++
194+
- cc: gcc
195+
cxx: g++
196+
env:
197+
CC: ${{ matrix.compiler.cc }}
198+
CCACHE_COMPRESS: true
199+
CCACHE_MAXSIZE: 500M
200+
CMAKE_C_COMPILER_LAUNCHER: ccache
201+
CMAKE_CXX_COMPILER_LAUNCHER: ccache
202+
CXX: ${{ matrix.compiler.cxx }}
203+
steps:
204+
- name: Checkout repository
205+
uses: actions/checkout@v4
206+
- name: Set up PPA
207+
run: |
208+
sudo apt-get install -y software-properties-common
209+
sudo apt-add-repository -y -u ppa:roblib/ppa
210+
- name: Install dependencies
81211
run: >
82212
sudo apt-get install -y
83213
build-essential
@@ -87,7 +217,7 @@ jobs:
87217
libboost-dev
88218
libbullet-dev
89219
libcomedi-dev
90-
libdc1394-22-dev
220+
libdc1394-dev
91221
libeigen3-dev
92222
libfcl-dev
93223
libnlopt-dev
@@ -99,66 +229,18 @@ jobs:
99229
libxml2-dev
100230
libxslt1-dev
101231
ninja-build
102-
- if: matrix.name == 'windows-2019-msvc'
103-
name: Enable Developer Command Prompt
104-
uses: ilammy/msvc-dev-cmd@v1
105-
- if: matrix.name == 'windows-2019-msvc'
106-
name: Install dependencies for MSVC
107-
working-directory: ${{ runner.workspace }}
108-
run: |
109-
curl -L https://github.com/roboticslibrary/rl-3rdparty/releases/download/latest/rl-3rdparty-msvc-14.2-x64.7z -o rl-3rdparty-msvc-14.2-x64.7z
110-
7z x rl-3rdparty-msvc-14.2-x64.7z -orl-3rdparty-install
111-
Write-Output "${{ runner.workspace }}\rl-3rdparty-install\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
112-
- if: matrix.name == 'windows-2019-msys2'
113-
name: Set up MSYS2
114-
uses: msys2/setup-msys2@v2
115-
with:
116-
install: >-
117-
mingw-w64-x86_64-boost
118-
mingw-w64-x86_64-bullet
119-
mingw-w64-x86_64-ccache
120-
mingw-w64-x86_64-cmake
121-
mingw-w64-x86_64-coin
122-
mingw-w64-x86_64-eigen3
123-
mingw-w64-x86_64-gcc
124-
mingw-w64-x86_64-libxml2
125-
mingw-w64-x86_64-libxslt
126-
mingw-w64-x86_64-ninja
127-
mingw-w64-x86_64-nlopt
128-
mingw-w64-x86_64-ode
129-
mingw-w64-x86_64-pqp
130-
mingw-w64-x86_64-qt5
131-
mingw-w64-x86_64-solid3
132-
mingw-w64-x86_64-soqt
133-
update: true
134-
- if: matrix.name == 'windows-2019-msys2'
135-
name: Add MSYS2 to PATH
136-
run: |
137-
Write-Output (msys2 -c "cygpath -w /mingw64/bin") | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
138-
- if: matrix.os != 'windows-2019'
139-
name: Update environment variables
232+
- name: Update environment variables
140233
run: |
141234
echo "CCACHE_BASEDIR=${{ runner.workspace }}" >> $GITHUB_ENV
142235
echo "CCACHE_DIR=${{ runner.workspace }}/.ccache" >> $GITHUB_ENV
143-
- if: matrix.os == 'windows-2019'
144-
name: Update environment variables
145-
run: |
146-
Write-Output "CCACHE_BASEDIR=${{ runner.workspace }}" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
147-
Write-Output "CCACHE_DIR=${{ runner.workspace }}\.ccache" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
148-
- if: matrix.cmake_compiler_launcher != ''
149-
name: Cache compiler
236+
- name: Cache compiler
150237
uses: actions/cache@v3
151238
with:
152239
path: ${{ runner.workspace }}/.ccache
153-
key: ${{ matrix.name }}-ccache-${{ github.sha }}
154-
restore-keys: ${{ matrix.name }}-ccache-
240+
key: ${{ matrix.os }}-${{ matrix.compiler.cc }}-ccache-${{ github.sha }}
241+
restore-keys: ${{ matrix.os }}-${{ matrix.compiler.cc }}-ccache-
155242
- name: Configure CMake
156-
run: >
157-
cmake
158-
-GNinja
159-
-DCMAKE_BUILD_TYPE=Release
160-
-S"${{ github.workspace }}"
161-
-B"${{ runner.workspace }}/rl-build"
243+
run: cmake -GNinja -DCMAKE_BUILD_TYPE=Release -S"${{ github.workspace }}" -B"${{ runner.workspace }}/rl-build"
162244
- name: Build
163245
working-directory: ${{ runner.workspace }}/rl-build
164246
run: cmake --build .
@@ -167,9 +249,9 @@ jobs:
167249
run: ctest --output-on-failure
168250
- name: Create archive
169251
working-directory: ${{ runner.workspace }}/rl-build
170-
run: cpack -G 7Z
171-
- name: Upload artifacts
172-
uses: actions/upload-artifact@v3
252+
run: cpack -G TXZ
253+
- name: Upload archive
254+
uses: actions/upload-artifact@v4
173255
with:
174-
name: ${{ matrix.name }}
175-
path: ${{ runner.workspace }}/rl-build/rl-*.7z
256+
name: ${{ matrix.os }}-${{ matrix.compiler.cc }}
257+
path: ${{ runner.workspace }}/rl-build/rl-*.tar.xz

0 commit comments

Comments
 (0)