Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Jan 6, 2025
1 parent 0a87c38 commit f16691a
Showing 1 changed file with 70 additions and 46 deletions.
116 changes: 70 additions & 46 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,18 +35,29 @@ 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

# conda
- if: matrix.pm == 'conda'
Expand All @@ -52,17 +69,28 @@ jobs:

# 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 +99,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 Down Expand Up @@ -100,33 +128,29 @@ jobs:
- run: cmake --build build
- run: ./build/main

#test-docker:
#runs-on: "ubuntu-latest"
#container: ${{ matrix.container }}
#strategy:
#matrix:
#container: ["archlinux/archlinux:base-devel"]
#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

#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

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

0 comments on commit f16691a

Please sign in to comment.