Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update CI #18

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 66 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 7 * * 0"

Expand All @@ -12,13 +17,14 @@ env:

jobs:
test:
name: "Test ${{ matrix.pm }} on ${{ matrix.os }}"
name: "Test ${{ matrix.pm }} on ${{ matrix.os }} ${{ matrix.arch }}"
runs-on: "${{ matrix.os }}-latest"
strategy:
fail-fast: false
matrix:
pm: ["pip", "conda", "nix"]
os: ["ubuntu", "macos", "windows"]
arch: ["main"]
exclude:
- pm: "pip"
os: "windows"
Expand All @@ -29,40 +35,64 @@ jobs:
os: "ubuntu"
- pm: "ros"
os: "ubuntu"
- pm: "brew"
os: "macos"
- arch: "aarch64"
os: "ubuntu"
pm: "pip"
- arch: "aarch64"
os: "ubuntu"
pm: "nix"
steps:
- uses: actions/checkout@v3

# pip
- if: matrix.pm == 'pip'
uses: actions/setup-python@v4 # required only because macos-latest still has python 2 by default…
# aarch64
- name: Set up QEMU
if: matrix.arch == 'aarch64'
uses: docker/setup-qemu-action@v3
with:
python-version: "3.11"
- if: matrix.pm == 'pip'
run: pip install pin[build]
- if: matrix.pm == 'pip'
run: echo "CMAKE_PREFIX_PATH=$(cmeel cmake)" >> $GITHUB_ENV
platforms: all

# brew
- if: matrix.pm == 'brew'
uses: Homebrew/actions/setup-homebrew@master
- if: matrix.pm == 'brew'
run: brew install pinocchio
- if: matrix.pm == 'brew'
run: echo "PATH=/opt/homebrew/opt/python@3/libexec/bin:$PATH" >> $GITHUB_ENV

# conda
- if: matrix.pm == 'conda'
uses: conda-incubator/setup-miniconda@v3
- if: matrix.pm == 'conda'
run: conda install -n test -c conda-forge pinocchio
run: conda install -n test -c conda-forge cmake cxx-compiler eigen eigenpy libboost-devel libboost-python-devel pinocchio
- if: matrix.pm == 'conda'
run: echo "CMAKE_PREFIX_PATH=$CONDA/envs/test" >> $GITHUB_ENV

# nix
- if: matrix.pm == 'nix'
uses: cachix/install-nix-action@v21
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
uses: cachix/install-nix-action@v30
- if: matrix.pm == 'nix'
run: nix-channel --update
uses: cachix/cachix-action@v15
with:
name: gepetto
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- if: matrix.pm == 'nix'
run: >
nix shell 'nixpkgs#python311Packages.pinocchio' -c
nix develop 'nixpkgs#python311Packages.pinocchio' -c
nix shell 'nixpkgs#python3Packages.pinocchio' -c
nix develop 'nixpkgs#python3Packages.pinocchio' -c
env | grep .=. >> $GITHUB_ENV

# pip
- if: matrix.pm == 'pip'
uses: actions/setup-python@v4 # required only because macos-latest still has python 2 by default…
with:
python-version: "3.13"
- 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
Expand All @@ -71,7 +101,7 @@ jobs:
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-py310-pinocchio
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

Expand All @@ -96,36 +126,36 @@ jobs:
| Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append


- run: cmake -B build -S .
- run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- run: cmake --build build
- run: ./build/main
- if: matrix.os != 'windows'
run: ./build/main
- if: matrix.os == 'windows'
run: .\build\Debug\main.exe

#test-docker:
# 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

#- run: curl https://github.com/Morganamilo/paru/releases/download/v1.11.2/paru-v1.11.2-x86_64.tar.zst -O
#- run: pacman -Syu "paru-*.tar.zst"
#- run: paru -Syu pinocchio

#- run: cmake -B build -S .
#- run: cmake --build build
#- run: ./build/main
## 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"

#test-aarch64:
#runs-on: "ubuntu-latest"
#container: ${{ matrix.container }}
#strategy:
#matrix:
#container: ["archlinux/archlinux:base-devel"]
#pm: ["pip", "conda", "nix"]
#steps:
#- uses: actions/checkout@v3
## 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
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
Minimal project using Pinocchio as Rigid Body Dynamics library.
This simple example shows how to link Pinocchio to a dedicated application.

Please report bugs or questions to <[email protected]> or simply open a new issue.

## Build instructions:
```sh
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
Expand Down
Loading