Skip to content

Commit

Permalink
Merge pull request #18 from Gepetto/nix
Browse files Browse the repository at this point in the history
Nix
  • Loading branch information
nim65s authored Jan 17, 2025
2 parents 6f113b9 + b99a4bc commit 4f64e3f
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# TODO: uv.lock not yet in https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/dependency-graph-supported-package-ecosystems
24 changes: 24 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "CI - Nix"

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
nix:
runs-on: "${{ matrix.os }}-latest"
strategy:
matrix:
os: [ubuntu, macos]
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
- uses: cachix/cachix-action@v15
with:
name: gepetto
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build -L
19 changes: 19 additions & 0 deletions .github/workflows/update-flake-lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: update-flake-lock

on:
workflow_dispatch:
schedule:
- cron: '0 12 9 * *'

jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Update flake.lock
uses: DeterminateSystems/update-flake-lock@main
with:
token: ${{ secrets.GH_TOKEN_FOR_UPDATES }}
2 changes: 2 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ pull_request_rules:
- name: merge automatically when CI passes and PR is approved
conditions:
- check-success = "CMake"
- check-success = "nix (macos)"
- check-success = "nix (ubuntu)"
- check-success = "Pip"
- check-success = "pre-commit.ci - pr"
- or:
Expand Down
17 changes: 14 additions & 3 deletions package.nix → default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
cmake,
lib,
pinocchio,
pkg-config,
python3Packages,
pythonImportsCheckHook,
qpsolvers,
scipy,
stdenv,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation {
pname = "toolbox-parallel-robots";
version = "0-unstable-2024-30-09";

Expand All @@ -30,8 +33,16 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
cmake
pkg-config
pythonImportsCheckHook
];
propagatedBuildInputs = [ python3Packages.pinocchio ];
propagatedBuildInputs = [
pinocchio
qpsolvers
scipy
];

doCheck = true;
pythonImportsCheck = [ "toolbox_parallel_robots" ];

meta = {
description = "Set of tools to work with robots with bilateral constraints";
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; };
packages = {
default = self'.packages.toolbox-parallel-robots;
toolbox-parallel-robots = pkgs.python3Packages.toPythonModule (pkgs.callPackage ./package.nix { });
toolbox-parallel-robots = pkgs.python3Packages.callPackage ./default.nix { };
};
};
};
Expand Down

0 comments on commit 4f64e3f

Please sign in to comment.