From d7c791c1c789ac284c504742c5a301076014e1f4 Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 13 Nov 2023 00:40:23 -0500 Subject: ci: add release gate for garnix --- flake.nix | 25 ++++++++++++++++++++++++- garnix.yaml | 1 + 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 7161570..b240c43 100644 --- a/flake.nix +++ b/flake.nix @@ -24,13 +24,36 @@ forAllSystems = fn: lib.genAttrs systems (sys: fn nixpkgs.legacyPackages.${sys}); in { + checks = forAllSystems (pkgs: { + ciGate = let + inherit (pkgs) system; + pkgs' = self.packages.${system}; + requirements = { + # all packages on linux are built + "x86_64-linux" = lib.mapAttrsToList (_: v: v.pname or v.name) pkgs'; + "aarch64-linux" = requirements."x86_64-linux"; + + # but not for macos + "aarch64-darwin" = ["modrinth-app"]; + + # garnix also doesn't support intel macs :( + "x86_64-darwin" = []; + }; + in + pkgs.runCommand "ci-gate" { + nativeBuildInputs = + builtins.filter (v: builtins.elem (v.pname or v.name) requirements.${system}) + (builtins.attrValues pkgs'); + } "touch $out"; + }); + packages = forAllSystems ( pkgs: let overlay = lib.fix (final: self.overlays.default final pkgs); /* this filters out packages that may be broken or not supported - on the current system. packages that have no `version` or `platforms` + on the current system. packages that have no `broken` or `platforms` meta attribute are assumed to be valid */ isValid = _: v: diff --git a/garnix.yaml b/garnix.yaml index 00227d6..a24c2e7 100644 --- a/garnix.yaml +++ b/garnix.yaml @@ -1,6 +1,7 @@ builds: exclude: [] include: + - "checks.*.*" - "packages.x86_64-linux.*" - "packages.aarch64-linux.*" - "packages.aarch64-darwin.modrinth-app" -- cgit v1.2.3