From 53d955b150df0aa72e41fbb7a2849582539715ff Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 28 Dec 2023 23:27:46 +0200 Subject: [PATCH] Nix/CI: add hyprlang-with-tests --- .github/workflows/nix.yml | 8 +++++++- flake.nix | 3 ++- nix/default.nix | 5 ++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index ea2ae5e..5889c5e 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -3,6 +3,12 @@ name: Build & Test on: [push, pull_request, workflow_dispatch] jobs: nix: + strategy: + matrix: + package: + - hyprlang + - hyprlang-with-tests + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -17,5 +23,5 @@ jobs: # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Build & Test - run: nix build --print-build-logs + run: nix build .#${{ matrix.package }} --print-build-logs diff --git a/flake.nix b/flake.nix index ac9e479..495d0f4 100644 --- a/flake.nix +++ b/flake.nix @@ -21,11 +21,12 @@ (builtins.substring 6 2 longDate) ]); in { - overlays.default = _: prev: { + overlays.default = _: prev: rec { hyprlang = prev.callPackage ./nix/default.nix { stdenv = prev.gcc13Stdenv; version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); }; + hyprlang-with-tests = hyprlang.override {doCheck = true;}; }; packages = genSystems (system: diff --git a/nix/default.nix b/nix/default.nix index 0204828..1dfa3fa 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -3,16 +3,15 @@ stdenv, cmake, version ? "git", + doCheck ? false, }: stdenv.mkDerivation { pname = "hyprlang"; - inherit version; + inherit version doCheck; src = ../.; nativeBuildInputs = [cmake]; - doCheck = true; - meta = with lib; { homepage = "https://github.com/hyprwm/hyprlang"; description = "The official implementation library for the hypr config language";