From a76ad54d005f1f8e618f2596970d2f510feee157 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 3 Dec 2024 12:46:29 +0100 Subject: [PATCH 1/6] ci: you run only once --- .github/workflows/ci-linux-ros.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-linux-ros.yml b/.github/workflows/ci-linux-ros.yml index a757fb8..d2d9719 100644 --- a/.github/workflows/ci-linux-ros.yml +++ b/.github/workflows/ci-linux-ros.yml @@ -1,5 +1,14 @@ name: CI - Linux - ROS -on: [push, pull_request] + +on: + push: + branches: + - master + - devel + pull_request: + branches: + - master + - devel jobs: CI: From 404bb40391d1f476a4c5c9a2b57b2c61ff169d0f Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 3 Dec 2024 12:48:29 +0100 Subject: [PATCH 2/6] flakify --- flake.lock | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..67827ee --- /dev/null +++ b/flake.lock @@ -0,0 +1,58 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733015953, + "narHash": "sha256-t4BBVpwG9B4hLgc6GUBuj3cjU7lP/PJfpTHuSqE+crk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac35b104800bff9028425fec3b6e8a41de2bbfff", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1730504152, + "narHash": "sha256-lXvH/vOfb4aGYyvFmZK/HlsNsr/0CVWlwYvo2rxJk3s=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/cc2f28000298e1269cea6612cd06ec9979dd5d7f.tar.gz" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..9445a20 --- /dev/null +++ b/flake.nix @@ -0,0 +1,34 @@ +{ + description = "C++ reimplementation of eiquadprog"; + + inputs = { + flake-parts.url = "github:hercules-ci/flake-parts"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = + inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = inputs.nixpkgs.lib.systems.flakeExposed; + perSystem = + { pkgs, self', ... }: + { + devShells.default = pkgs.mkShell { inputsFrom = [ self'.packages.default ]; }; + packages = { + default = self'.packages.eiquadprog; + eiquadprog = pkgs.eiquadprog.overrideAttrs (_: { + src = pkgs.lib.fileset.toSource { + root = ./.; + fileset = pkgs.lib.fileset.unions [ + ./CMakeLists.txt + ./include + ./package.xml + ./src + ./tests + ]; + }; + }); + }; + }; + }; +} From 11e99fb5422ee52dad9d6f21d32fb8e5e4cbc21d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 3 Dec 2024 12:48:58 +0100 Subject: [PATCH 3/6] ci: nix --- .github/workflows/nix.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/nix.yml diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..52b45d9 --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,19 @@ +name: "CI - Nix" + +on: + push: + +jobs: + nix: + runs-on: "${{ matrix.os }}-latest" + strategy: + matrix: + os: [ubuntu, macos] + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v27 + - uses: cachix/cachix-action@v15 + with: + name: gepetto + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix build -L From 0ca671808357ed8971c562d7bb012ec201383692 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 3 Dec 2024 12:49:38 +0100 Subject: [PATCH 4/6] ci: dependabot --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..203f3c8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" From 1bf62073df93bb0845443d8cccec489cac668bc1 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 3 Dec 2024 12:56:08 +0100 Subject: [PATCH 5/6] mergify: gitlab-ci --- .mergify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.mergify.yml b/.mergify.yml index 7c98dd8..97ce613 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -7,6 +7,7 @@ pull_request_rules: - check-success = "CI (rolling)" - check-success = "nix (macos)" - check-success = "nix (ubuntu)" + - check-success = "gitlab-ci" - check-success = "pre-commit.ci - pr" - or: - author = pre-commit-ci[bot] From 731efbc69168bdd2277020d091517be7f288275c Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Tue, 3 Dec 2024 12:58:17 +0100 Subject: [PATCH 6/6] ci: fix ROS name --- .github/workflows/ci-linux-ros.yml | 2 +- .mergify.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci-linux-ros.yml b/.github/workflows/ci-linux-ros.yml index d2d9719..ffb3f94 100644 --- a/.github/workflows/ci-linux-ros.yml +++ b/.github/workflows/ci-linux-ros.yml @@ -11,7 +11,7 @@ on: - devel jobs: - CI: + ROS: strategy: matrix: env: diff --git a/.mergify.yml b/.mergify.yml index 7c98dd8..9c925ec 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -1,10 +1,10 @@ pull_request_rules: - name: merge automatically when CI passes and PR is approved conditions: - - check-success = "CI (humble)" - - check-success = "CI (iron)" - - check-success = "CI (jazzy)" - - check-success = "CI (rolling)" + - check-success = "ROS (humble)" + - check-success = "ROS (iron)" + - check-success = "ROS (jazzy)" + - check-success = "ROS (rolling)" - check-success = "nix (macos)" - check-success = "nix (ubuntu)" - check-success = "pre-commit.ci - pr"