From ee18ddcebcdd5744f7a5abaecfd1c4441ba69c35 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Thu, 1 Dec 2022 17:05:32 +0100 Subject: [PATCH] Add Drone CI --- .drone.yml | 38 ++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ flake.nix | 25 +++++++++++++++---------- 3 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..f49665c --- /dev/null +++ b/.drone.yml @@ -0,0 +1,38 @@ +--- +kind: pipeline +name: default + +node: + nix-daemon: 1 + +steps: + - name: check formatting + image: nixpkgs/nix:nixos-22.05 + commands: + - nix-shell -p cargo --run "cargo fmt -- --check" + + - name: build + image: nixpkgs/nix:nixos-22.05 + commands: + - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#debug.x86_64-linux.tricot + + - name: test + image: nixpkgs/nix:nixos-22.05 + commands: + - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#test.x86_64-linux.tricot + - ./result-bin/bin/tricot-* + +trigger: + event: + - custom + - push + - pull_request + - tag + - cron + + +--- +kind: signature +hmac: c99528a32d4c9f5016e6143e08291c99a8b248880f7dc3ee3550803e16cd28ad + +... diff --git a/README.md b/README.md index 503b686..74ee06b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Tricot +[![Build Status](https://drone.deuxfleurs.fr/api/badges/Deuxfleurs/tricot/status.svg)](https://drone.deuxfleurs.fr/Deuxfleurs/tricot) + Tricot is a reverse-proxy for exposing your services via TLS that integrates well with Consul and Nomad. Tricot does the following things: diff --git a/flake.nix b/flake.nix index 450a5a1..351bd41 100644 --- a/flake.nix +++ b/flake.nix @@ -15,17 +15,22 @@ overlays = [ cargo2nix.overlays.default ]; }; packageFun = import ./Cargo.nix; - packageSet = pkgs.rustBuilder.makePackageSet { - inherit packageFun; - release = true; - rustVersion = "1.63.0"; - }; - tricot = packageSet.workspace.tricot { - compileMode = "build"; - }; + rustVersion = "1.63.0"; + + compile = args: compileMode: + let + packageSet = pkgs.rustBuilder.makePackageSet ({ + inherit packageFun rustVersion; + } // args); + in + packageSet.workspace.tricot { + inherit compileMode; + }; in { - packages.x86_64-linux.tricot = tricot; - packages.x86_64-linux.default = tricot; + test.x86_64-linux.tricot = compile { release = false; } "test"; + debug.x86_64-linux.tricot = compile { release = false; } "build"; + packages.x86_64-linux.tricot = compile { release = true; } "build"; + packages.x86_64-linux.default = self.packages.x86_64-linux.tricot; }; }