diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..8252b041b8f0e9082af5a5576dfd39a5e338a503 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,44 @@ +# Use a template that makes pipelines run for the default branch, tags, and +# all types of merge request pipelines. +include: + - template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml' + +# The jobs all use the `nix` CLI so make sure we have it. +image: "nixos/nix:2.13.2" + +default: + # Choose a native Nix runner and we can use the local system's Nix store as + # our Nix cache. + tags: + - "nix" + +variables: + # Pick a nixpkgs to get cachix and bash from. Nothing else + # Turn on some `nix` CLI features that aren't on by default. + NIX_CONFIG: "experimental-features = nix-command flakes" + +# Run the standard Haskell linter over the library and test suite sources. +hlint: + script: >- + nix run .#hlint -- src/ test/ + +# Use cabal to build the library and test suite and then run the test suite. +cabal-build-and-test: + script: + - | + nix run .#cabal-test + +# Use nix to build the library and test suite and run the test suite. +nix-build-and-test: + script: >- + nix build + +# Force a build of the dev shell dependencies so we know they still work. +# Also, this populates the cache with the results which is a big win for every +# developer using our cache. +# +# We only have an x86_64-linux builder so we can't build the aarch64-darwin +# shell. Sorry... +nix-develop: + script: >- + nix build .#devShells.x86_64-linux.default diff --git a/flake.lock b/flake.lock index 83cd9614ddef677856e3cf0dba517a00a0dad145..5637403e6e1137eac2e48cd977003873cfac7f02 100644 --- a/flake.lock +++ b/flake.lock @@ -71,9 +71,7 @@ "hs-flake-utils": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": [ - "nixpkgs" - ], + "nixpkgs": "nixpkgs", "pre-commit-hooks": "pre-commit-hooks" }, "locked": { @@ -93,18 +91,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1670543317, - "narHash": "sha256-4mMR56rtxKr+Gwz399jFr4i76SQZxsLWxxyfQlPXRm0=", - "owner": "nixos", + "lastModified": 1659606041, + "narHash": "sha256-W4/u2ssr3fS4XOtltrsDD9w2kF4jYYZr6JyPGUW2jdI=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "7a6a010c3a1d00f8470a5ca888f2f927f1860a19", + "rev": "5f9b871b72b24f066b1a1e189efd0669f2888c49", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-22.11", - "repo": "nixpkgs", - "type": "github" + "id": "nixpkgs", + "type": "indirect" } }, "nixpkgs-stable": { @@ -155,7 +151,10 @@ "inputs": { "flake-utils": "flake-utils", "hs-flake-utils": "hs-flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "hs-flake-utils", + "nixpkgs" + ] } } }, diff --git a/flake.nix b/flake.nix index 9cd8d5a53ea95ed0630454613ec101fe73030616..716dbb87e92a28ebb0cdf113cdbcf88debcd6779 100644 --- a/flake.nix +++ b/flake.nix @@ -1,12 +1,11 @@ { - description = "tahoe-lafs-immutable-uploader"; + description = "tahoe-capabilities"; inputs = { # Nix Inputs - nixpkgs.url = github:nixos/nixpkgs/?ref=nixos-22.11; + nixpkgs.follows = "hs-flake-utils/nixpkgs"; flake-utils.url = github:numtide/flake-utils; hs-flake-utils.url = "git+https://whetstone.private.storage/jcalderone/hs-flake-utils.git?ref=main"; - hs-flake-utils.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = {