Skip to content
Snippets Groups Projects
Commit 91a92dd1 authored by Daniel Firth's avatar Daniel Firth
Browse files

add cachix CI step

parent 8ca8d364
No related merge requests found
This commit is part of merge request !4. Comments created here will be created in the context of that merge request.
let Prelude =
env:DHALL_PRELUDE
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v20.1.0/Prelude/package.dhall
sha256:26b0ef498663d269e4dc6a82b0ee289ec565d683ef4c00d0ebdd25333a5a3c98
let H =
https://gitlab.horizon-haskell.net/dhall/horizon-spec/-/raw/0.6/dhall/package.dhall
sha256:9a80164572526dc5350f105c8db0790fdf36634629b4cf03402ba14fd173d121
let toStep
: Text → Text
= λ(x : Text) →
"nix build --accept-flake-config --json .#${x} | jq -r '.[].outputs | to_entries[].value' | cachix push horizon"
let toEchoStep
: Text → Text
= λ(x : Text) → "echo \"${toStep x}\""
let input =
Prelude.Map.keys
Text
H.HaskellPackage.Type
( merge
{ MakePackageSet =
λ(x : H.PackageSetExportSettings) → x.packageSet.packages
, MakeOverlay = λ(x : H.OverlayExportSettings) → x.overlay.packages
}
./horizon.dhall
)
let packages = Prelude.List.map Text Text toEchoStep (input : List Text)
in "("
++ Prelude.List.fold
Text
packages
Text
(λ(x : Text) → λ(y : Text) → x ++ ";" ++ y)
""
++ ") | parallel -j 16"
stages:
- generate
- check
- cache
generate-flake-ci:
stage: generate
......@@ -16,3 +17,11 @@ flake-ci:
- artifact: flake-ci.yml
job: generate-flake-ci
strategy: depend
cachix:
stage: cache
only:
refs:
- master
- cachix
script: nix-shell -p jq cachix parallel --command 'dhall --file .cachix.dhall | dhall text | bash'
......@@ -2,6 +2,11 @@
description = "Horizon Haskell Platform";
nixConfig = {
extra-substituters = "https://horizon.cachix.org";
extra-trusted-public-keys = "horizon.cachix.org-1:MeEEDRhRZTgv/FFGCv3479/dmJDfJ82G6kfUDxMSAw0=";
};
inputs = {
get-flake.url = "github:ursi/get-flake";
flake-parts.url = "github:hercules-ci/flake-parts";
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment