Nix/CI: add hyprlang-with-tests

This commit is contained in:
Mihai Fufezan 2023-12-28 23:27:46 +02:00
parent 046fe8531a
commit 53d955b150
No known key found for this signature in database
3 changed files with 11 additions and 5 deletions

View file

@ -3,6 +3,12 @@ name: Build & Test
on: [push, pull_request, workflow_dispatch] on: [push, pull_request, workflow_dispatch]
jobs: jobs:
nix: nix:
strategy:
matrix:
package:
- hyprlang
- hyprlang-with-tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -17,5 +23,5 @@ jobs:
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build & Test - name: Build & Test
run: nix build --print-build-logs run: nix build .#${{ matrix.package }} --print-build-logs

View file

@ -21,11 +21,12 @@
(builtins.substring 6 2 longDate) (builtins.substring 6 2 longDate)
]); ]);
in { in {
overlays.default = _: prev: { overlays.default = _: prev: rec {
hyprlang = prev.callPackage ./nix/default.nix { hyprlang = prev.callPackage ./nix/default.nix {
stdenv = prev.gcc13Stdenv; stdenv = prev.gcc13Stdenv;
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
}; };
hyprlang-with-tests = hyprlang.override {doCheck = true;};
}; };
packages = genSystems (system: packages = genSystems (system:

View file

@ -3,16 +3,15 @@
stdenv, stdenv,
cmake, cmake,
version ? "git", version ? "git",
doCheck ? false,
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "hyprlang"; pname = "hyprlang";
inherit version; inherit version doCheck;
src = ../.; src = ../.;
nativeBuildInputs = [cmake]; nativeBuildInputs = [cmake];
doCheck = true;
meta = with lib; { meta = with lib; {
homepage = "https://github.com/hyprwm/hyprlang"; homepage = "https://github.com/hyprwm/hyprlang";
description = "The official implementation library for the hypr config language"; description = "The official implementation library for the hypr config language";