diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..e001702 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,38 @@ +image: silex/emacs:26.1-alpine-dev + +stages: + - test + - package + - deploy + +test-oni-bookmark: + stage: test + script: make test-oni-bookmark + +test-oni-alert: + stage: test + script: make test-oni-alert + +package: + stage: package + before_script: + - rm -rf bin/ + - mkdir bin/ + script: make package + artifacts: + paths: + - bin/ + +deploy-oni-bookmark: + stage: deploy + dependencies: + - package + before_script: + - mkdir ~/.ssh/ + - echo "$DEPLOY_KEY" > ~/.ssh/id_rsa + - chmod 600 ~/.ssh/id_rsa + - echo -e "$SSH_CONFIG" > ~/.ssh/config + - echo "$KNOWN_HOSTS" > ~/.ssh/known_hosts + - apk update && apk add rsync + script: + - rsync -v -c -r --delete bin/ elpa@ryuslash.org:usr/share/emacs/elpa diff --git a/GNUmakefile b/GNUmakefile new file mode 100644 index 0000000..3f364b8 --- /dev/null +++ b/GNUmakefile @@ -0,0 +1,26 @@ +FILES := $(wildcard *.el) + +PACKAGE_TARGETS := $(addprefix package-,$(FILES)) + +package: $(PACKAGE_TARGETS) + +package-%: % + emacs --batch \ + --load oni-package.el \ + --funcall package-initialize \ + --eval '(package-upload-file "$^")' + +test-%: + emacs --batch \ + --load oni-package.el \ + --funcall package-initialize \ + --eval '(package-refresh-contents)' \ + --load ert \ + --load "test/$*-test.el" \ + --funcall package-initialize \ + --eval "(package-install-file \"oni-data-dir.el\")" \ + --eval "(package-install-file \"$*.el\")" \ + --funcall ert-run-tests-batch-and-exit + +clean: + rm -fv $(FILES) diff --git a/oni-package.el b/oni-package.el index 101dd71..6efd62c 100644 --- a/oni-package.el +++ b/oni-package.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 20190218235251 +;; Version: 20190314002658 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -48,10 +48,12 @@ (add-to-list 'package-archives `("oni" . "https://ryuslash.org/elpa/")) +(setq package-update-news-on-upload t) + ;;; Specify where to upload packages to. Used by ;;; ‘package-upload-buffer’ and ‘package-upload-file’. (setq package-archive-upload-base - "/ssh:ryuslash.org:usr/share/emacs/elpa/") + "bin/") ;;; Temporary fix for `package-maint-add-news-item', until I get my ;;; Copyright assignment back in order. diff --git a/test/oni-alert-test.el b/test/oni-alert-test.el new file mode 100644 index 0000000..f8574e2 --- /dev/null +++ b/test/oni-alert-test.el @@ -0,0 +1,9 @@ +(ert-deftest oni-alert-test-autoloads () + "Test that `oni-alert' gets loaded automatically." + (require 'alert) + (should (featurep 'oni-alert))) + +(ert-deftest oni-alert-test-sets-default-style () + "Test that `oni-alert' test the default style." + (require 'alert) + (should (eql alert-default-style 'libnotify))) diff --git a/test/oni-bookmark-test.el b/test/oni-bookmark-test.el new file mode 100644 index 0000000..32d0c77 --- /dev/null +++ b/test/oni-bookmark-test.el @@ -0,0 +1,9 @@ +(ert-deftest oni-bookmark-test-sets-default-file () + "Test that oni-bookarks works." + (require 'bookmark) + (should (string-match "/data/" bookmark-default-file))) + +(ert-deftest oni-bookmark-test-autoloads () + "Test that `oni-bookmark' gets loaded automatically." + (require 'bookmark) + (should (featurep 'oni-bookmark)))