about summary refs log tree commit diff
path: root/ci/pipelines/post-receive.nix
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-27T17·27+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-27T17·29+0100
commit78172233f808f60000b5aa87a1cf92746b856c0c (patch)
tree75bf9b005fa70e56b85b8bead5e21db5c2b15021 /ci/pipelines/post-receive.nix
parentd67dbec7e82b7c907d7c1c4fa92ae922abeca059 (diff)
Add build, lint Emacs steps to post-receive pipeline
TL;DR:
- Define runEmacsScript to emacs/default.nix for ci/pipelines/post-receive
- Write script.el to call (load init.el) and catch any errors
- Lint Elisp with gonewest818/elisp-lint

Also nice how Buildkite supports :gnu: emojis!
Diffstat (limited to 'ci/pipelines/post-receive.nix')
-rw-r--r--ci/pipelines/post-receive.nix33
1 files changed, 32 insertions, 1 deletions
diff --git a/ci/pipelines/post-receive.nix b/ci/pipelines/post-receive.nix
index 3f14dfade557..d41c3b67b328 100644
--- a/ci/pipelines/post-receive.nix
+++ b/ci/pipelines/post-receive.nix
@@ -1,6 +1,16 @@
-{ pkgs, ... }:
+{ briefcase, pkgs, ... }:
 
 let
+  elispLintSrc = builtins.fetchGit {
+    url = "https://github.com/gonewest818/elisp-lint";
+    rev = "2b645266be8010a6a49c6d0ebf6a3ad5bd290ff4";
+  };
+
+  scriptEl = builtins.path {
+    path = ./script.el;
+    name = "script.el";
+  };
+
   pipeline.steps = [
     {
       key = "lint-secrets";
@@ -14,6 +24,27 @@ let
       depends_on = "lint-secrets";
     }
     {
+      key = "init-emacs";
+      command = ''
+        ${briefcase.emacs.runScript scriptEl} ${briefcase.emacs.initEl}
+      '';
+      label = ":gnu: initialize Emacs";
+      depends_on = "build-briefcase";
+    }
+    {
+      key = "lint-emacs";
+      command = ''
+        ${briefcase.emacs.nixos}/bin/wpcarros-emacs \
+          --quick \
+          --batch \
+          --load ${elispLintSrc}/elisp-lint.el \
+          --funcall elisp-lint-files-batch \
+          "$@"
+      '';
+      label = ":gnu: lint Emacs";
+      depends_on = "init-emacs";
+    }
+    {
       key = "build-socrates";
       command = ''
         nix-build '<nixpkgs/nixos>' \