From 30962d21beb2133b5d986b8aebfe64408be5e80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 13 Mar 2020 11:57:58 +0100 Subject: [PATCH 1/3] Add CI with github actions --- .github/workflows/test.yml | 14 ++++++++++++++ release.nix | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..f261cd0bc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,14 @@ +name: "Test" +on: + pull_request: + push: +jobs: + tests: + strategy: + matrix: + os: [ubuntu-18.04, macos] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: cachix/install-nix-action@v8 + - run: nix-build release.nix --arg nix '{ outPath = ./.; revCount = 123; shortRev = "abcdefgh"; }' --arg systems '[ builtins.currentSystem ]' -A build -A binaryTarball -A perlBindings -A installerScript diff --git a/release.nix b/release.nix index 1f592424b..45c2f14ba 100644 --- a/release.nix +++ b/release.nix @@ -348,9 +348,9 @@ let substitute ${./scripts/install.in} $out/install \ ${pkgs.lib.concatMapStrings (system: "--replace '@binaryTarball_${system}@' $(nix --experimental-features nix-command hash-file --base16 --type sha256 ${binaryTarball.${system}}/*.tar.xz) ") - [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ] + systems } \ - --replace '@nixVersion@' ${build.x86_64-linux.src.version} + --replace '@nixVersion@' ${build.${builtins.head systems}.src.version} echo "file installer $out/install" >> $out/nix-support/hydra-build-products ''; From 90b805ef251a3e3244b2cddcf815bf36c2f4e2ab Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 13 Mar 2020 15:56:25 +0100 Subject: [PATCH 2/3] Remove build and binaryTarball since they're included in installerScript --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f261cd0bc..87997414d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,4 +11,4 @@ jobs: steps: - uses: actions/checkout@v2 - uses: cachix/install-nix-action@v8 - - run: nix-build release.nix --arg nix '{ outPath = ./.; revCount = 123; shortRev = "abcdefgh"; }' --arg systems '[ builtins.currentSystem ]' -A build -A binaryTarball -A perlBindings -A installerScript + - run: nix-build release.nix --arg nix '{ outPath = ./.; revCount = 123; shortRev = "abcdefgh"; }' --arg systems '[ builtins.currentSystem ]' -A installerScript -A perlBindings From c0a3ff7d47f5a0d0322689d446d71e2372de37d1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 13 Mar 2020 16:39:35 +0100 Subject: [PATCH 3/3] Fix macOS --- release.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/release.nix b/release.nix index 45c2f14ba..b1cb1e437 100644 --- a/release.nix +++ b/release.nix @@ -340,8 +340,7 @@ let installerScript = pkgs.runCommand "installer-script" - { buildInputs = [ build.x86_64-linux ]; - } + { buildInputs = [ build.${builtins.currentSystem or "x86_64-linux"} ]; } '' mkdir -p $out/nix-support