-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
13 changed files
with
570 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
description = "OCaml-SSL Nix Flake"; | ||
|
||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
inputs.nixpkgs.inputs.flake-utils.follows = "flake-utils"; | ||
inputs.nixpkgs.url = "github:anmonteiro/nix-overlays"; | ||
|
||
outputs = { self, nixpkgs, flake-utils }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = nixpkgs.legacyPackages."${system}"; | ||
in | ||
rec { | ||
defaultPackage = pkgs.callPackage ./nix { }; | ||
devShells = { | ||
default = pkgs.callPackage ./shell.nix { | ||
packages = [ defaultPackage ]; | ||
}; | ||
|
||
release = pkgs.callPackage ./shell.nix { | ||
packages = [ defaultPackage ]; | ||
release-mode = true; | ||
}; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ ocamlVersion }: | ||
|
||
let | ||
lock = builtins.fromJSON (builtins.readFile ./../../flake.lock); | ||
src = fetchGit { | ||
url = with lock.nodes.nixpkgs.locked; "https://github.com/${owner}/${repo}"; | ||
inherit (lock.nodes.nixpkgs.locked) rev; | ||
# inherit (lock.nodes.nixpkgs.original) ref; | ||
allRefs = true; | ||
}; | ||
|
||
pkgs = import "${src}" { | ||
extraOverlays = [ | ||
(self: super: { | ||
ocamlPackages = super.ocaml-ng."ocamlPackages_${ocamlVersion}"; | ||
}) | ||
]; | ||
}; | ||
|
||
in | ||
pkgs.callPackage ./.. { doCheck = true; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ stdenv | ||
, lib | ||
, ocamlPackages | ||
, openssl-oc | ||
, doCheck ? false | ||
, pkg-config | ||
}: | ||
|
||
with ocamlPackages; | ||
|
||
buildDunePackage { | ||
pname = "ssl"; | ||
version = "n/a"; | ||
|
||
useDune2 = true; | ||
|
||
src = ../.; | ||
|
||
nativeBuildInputs = [ ocaml dune findlib pkg-config ]; | ||
buildInputs = [ dune-configurator ]; | ||
propagatedBuildInputs = [ | ||
openssl-oc.dev | ||
]; | ||
checkInputs = [ alcotest ]; | ||
|
||
inherit doCheck; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
{ lib }: | ||
|
||
let | ||
commonSteps = { name, signingKey }: [ | ||
{ | ||
uses = "actions/checkout@v2"; | ||
"with" = { | ||
"submodules" = "recursive"; | ||
}; | ||
} | ||
{ | ||
uses = "cachix/[email protected]"; | ||
} | ||
{ | ||
uses = "cachix/cachix-action@v10"; | ||
"with" = { | ||
inherit name signingKey; | ||
}; | ||
} | ||
|
||
]; | ||
|
||
job = | ||
{ steps | ||
, ocamlVersions ? [ | ||
"4_12" | ||
"4_13" | ||
"4_14" | ||
"5_00" | ||
] | ||
, ... | ||
}@attrs: (builtins.removeAttrs attrs [ "ocamlVersions" ]) // { | ||
strategy = { | ||
fail-fast = false; | ||
matrix = { | ||
ocamlVersion = ocamlVersions | ||
; | ||
}; | ||
}; | ||
}; | ||
|
||
gh-actions = { | ||
cachixBuild = { name, branches ? [ "master" ], os, cachix }: | ||
lib.generators.toYAML { } { | ||
inherit name; | ||
on = { | ||
pull_request = null; | ||
push = { | ||
inherit branches; | ||
}; | ||
}; | ||
|
||
jobs = lib.mapAttrs | ||
(os: { run, name, ... }@conf: | ||
job ({ | ||
runs-on = os; | ||
steps = commonSteps cachix | ||
++ [{ inherit name run; }]; | ||
} // (if (conf ? ocamlVersions) then { | ||
inherit (conf) ocamlVersions; | ||
} else { }))) | ||
os; | ||
}; | ||
}; | ||
|
||
in | ||
|
||
gh-actions.cachixBuild { | ||
name = "Build"; | ||
cachix = { | ||
name = "anmonteiro"; | ||
signingKey = "\${{ secrets.CACHIX_SIGNING_KEY }}"; | ||
}; | ||
os = { | ||
macos-latest = { | ||
name = "Run nix-build"; | ||
ocamlVersions = [ "4_13" "4_14" "5_00" ]; | ||
run = "nix-build ./nix/ci/test.nix -A native --argstr ocamlVersion \${{ matrix.ocamlVersion }}"; | ||
}; | ||
ubuntu-latest = { | ||
ocamlVersions = [ "4_12" "4_13" "4_14" "5_00" ]; | ||
name = "Run nix-build"; | ||
run = "nix-build ./nix/ci/test.nix -A native -A musl64 --argstr ocamlVersion \${{ matrix.ocamlVersion }}"; | ||
}; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ packages | ||
, lib | ||
, mkShell | ||
, release-mode ? false | ||
, cacert | ||
, curl | ||
, ocamlPackages | ||
, git | ||
, opam | ||
}: | ||
|
||
mkShell { | ||
OCAMLRUNPARAM = "b"; | ||
inputsFrom = packages; | ||
buildInputs = | ||
(with ocamlPackages; [ | ||
merlin | ||
ocamlformat | ||
utop | ||
alcotest | ||
]) ++ lib.optional release-mode [ | ||
cacert | ||
curl | ||
ocamlPackages.dune-release | ||
git | ||
opam | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.