-
Notifications
You must be signed in to change notification settings - Fork 9
163 lines (147 loc) · 4.99 KB
/
Copy pathtest.yml
File metadata and controls
163 lines (147 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 7 * * 0"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ROBOTPKG_URL: "http://robotpkg.openrobots.org/packages/debian"
ROS: "jazzy"
UBUNTU: "noble"
jobs:
test:
name: "Test ${{ matrix.pm }} on ${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
pm: ["pip", "conda", "nix"]
os: ["ubuntu-24.04", "ubuntu-24.04-arm", "macos-15-intel", "macos-15", "windows-latest"]
exclude:
- pm: "pip"
os: "windows-latest"
- pm: "nix"
os: "windows-latest"
- pm: "nix"
os: "macos-15-intel"
include:
- pm: "robotpkg"
os: "ubuntu-24.04"
- pm: "ros"
os: "ubuntu-24.04"
- pm: "brew"
os: "macos-15"
steps:
- uses: actions/checkout@v5
# brew
- if: matrix.pm == 'brew'
uses: Homebrew/actions/setup-homebrew@master
- if: matrix.pm == 'brew'
run: brew install pinocchio
# conda
- if: matrix.pm == 'conda'
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
activate-environment: pinocchio
environment-file: .github/workflows/conda/environment.yml
auto-activate-base: false
auto-update-conda: true
conda-remove-defaults: true
# nix
- if: matrix.pm == 'nix'
uses: cachix/install-nix-action@v31
- if: matrix.pm == 'nix'
run: >
nix shell 'nixpkgs#python3Packages.pinocchio' -c
nix develop 'nixpkgs#python3Packages.pinocchio' -c
env | grep .=. >> $GITHUB_ENV
- if: matrix.pm == 'nix'
run: echo "CMAKE_PREFIX_PATH=${NIXPKGS_CMAKE_PREFIX_PATH}" >> $GITHUB_ENV
# pip
- if: matrix.pm == 'pip'
uses: actions/setup-python@v6
with:
python-version: "3.14"
- if: matrix.pm == 'pip'
run: pip install pin[build]
- if: matrix.pm == 'pip'
run: echo "CMAKE_PREFIX_PATH=$(cmeel cmake)" >> $GITHUB_ENV
# robotpkg
- if: matrix.pm == 'robotpkg'
run: sudo wget "${ROBOTPKG_URL}/robotpkg.gpg" -O /robotpkg.gpg
- if: matrix.pm == 'robotpkg'
run: >
echo "deb [arch=amd64 signed-by=/robotpkg.gpg] ${ROBOTPKG_URL}/pub ${UBUNTU} robotpkg"
| sudo tee /etc/apt/sources.list.d/robotpkg.list
- if: matrix.pm == 'robotpkg'
run: sudo apt-get update && sudo apt-get install -qy robotpkg-py3*-pinocchio
- if: matrix.pm == 'robotpkg'
run: echo "CMAKE_PREFIX_PATH=/opt/openrobots" >> $GITHUB_ENV
# ros
- if: matrix.pm == 'ros'
run: sudo wget "https://raw.githubusercontent.com/ros/rosdistro/master/ros.key" -O /ros.key
- if: matrix.pm == 'ros'
run: >
echo "deb [arch=amd64 signed-by=/ros.key] http://packages.ros.org/ros2/ubuntu ${UBUNTU} main"
| sudo tee /etc/apt/sources.list.d/ros.list
- if: matrix.pm == 'ros'
run: sudo apt-get update && sudo apt-get install -qy "ros-${ROS}-pinocchio"
- if: matrix.pm == 'ros'
run: echo "CMAKE_PREFIX_PATH=/opt/ros/${ROS}" >> $GITHUB_ENV
- name: Configure and build [MacOS/Ubuntu]
shell: bash -el {0}
if: contains(matrix.os, 'macos') || contains(matrix.os, 'ubuntu')
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-GNinja \
-DPYTHON_EXECUTABLE=$(which python3)
cmake --build build
./build/main
- name: Configure and build [Windows]
shell: cmd /C CALL {0}
if: contains(matrix.os, 'windows')
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -GNinja
cmake --build build
build\main
docker:
runs-on: "ubuntu-latest"
container: "ghcr.io/stack-of-tasks/pinocchio:devel" # todo: latest ?
steps:
- uses: actions/checkout@v5
- run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- run: cmake --build build
- run: ./build/main
# TODO: way too long
#test-arch:
#runs-on: "ubuntu-latest"
#container: ${{ matrix.container }}
#strategy:
#fail-fast: false
#matrix:
#container: ["archlinux/archlinux:base-devel"]
#env:
#MAKEFLAGS: -j4
#steps:
#- uses: actions/checkout@v3
## install paru
#- run: pacman -Syu --noconfirm git
#- run: useradd -mG wheel user
#- run: echo "%wheel ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
#- run: git clone https://aur.archlinux.org/paru-bin.git
#- run: chown -R user paru-bin
#- run: su user -c "makepkg -D paru-bin -si --noconfirm"
## use paru to install pinocchio and its dependencies from AUR
#- run: su user -c "paru -Syu --noconfirm pinocchio"
#- run: cmake -B build -S .
#- run: cmake --build build
#- run: ./build/main