From 32cb862f987a61c87cc6a32d1437031941875144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 15 Mar 2021 06:09:41 +0100 Subject: [PATCH] add ci configuration --- .github/dependabot.yml | 6 ++++++ .github/workflows/test.yml | 20 ++++++++++++++++++++ default.nix | 33 ++------------------------------- hydra.nix | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 63 insertions(+), 31 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test.yml create mode 100644 hydra.nix diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2549b24 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,20 @@ +name: "Test" +on: + pull_request: + push: + schedule: + - cron: '51 2 * * *' +jobs: + tests: + strategy: + matrix: + nixPath: + - nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-20.09.tar.gz + - nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz + os: [ ubuntu-latest, macos-latest ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: cachix/install-nix-action@v12 + - name: build + run: NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz nix-build diff --git a/default.nix b/default.nix index 05d4c8d..b2286a6 100644 --- a/default.nix +++ b/default.nix @@ -1,31 +1,2 @@ -{ stdenv -, nixFlakes -, meson -, cmake -, ninja -, pkg-config -, boost -, nlohmann_json -, srcDir ? ./. -}: - -stdenv.mkDerivation rec { - pname = "hydra-eval-jobs"; - version = "0.0.1"; - src = srcDir; - buildInputs = [ - nlohmann_json nixFlakes boost - ]; - nativeBuildInputs = [ - meson pkg-config ninja - # nlohmann_json can be only discovered via cmake files - cmake - ]; - meta = with stdenv.lib; { - description = "Hydra's builtin hydra-eval-jobs as a standalone"; - homepage = "https://github.com/Mic92/hydra-eval-jobs"; - license = licenses.mit; - maintainers = with maintainers; [ mic92 ]; - platforms = platforms.unix; - }; -} +{ pkgs ? import {} }: +pkgs.callPackage ./hydra.nix {} diff --git a/hydra.nix b/hydra.nix new file mode 100644 index 0000000..36c3228 --- /dev/null +++ b/hydra.nix @@ -0,0 +1,35 @@ +{ stdenv +, nixFlakes +, meson +, cmake +, ninja +, pkg-config +, boost +, nlohmann_json +, srcDir ? ./. +}: + +let + filterMesonBuild = dir: builtins.filterSource + (path: type: type != "directory" || baseNameOf path != "build") dir; +in +stdenv.mkDerivation rec { + pname = "hydra-eval-jobs"; + version = "0.0.1"; + src = filterMesonBuild srcDir; + buildInputs = [ + nlohmann_json nixFlakes boost + ]; + nativeBuildInputs = [ + meson pkg-config ninja + # nlohmann_json can be only discovered via cmake files + cmake + ]; + meta = with stdenv.lib; { + description = "Hydra's builtin hydra-eval-jobs as a standalone"; + homepage = "https://github.com/Mic92/hydra-eval-jobs"; + license = licenses.mit; + maintainers = with maintainers; [ mic92 ]; + platforms = platforms.unix; + }; +}