ci: add test workflow and fix code quality issues
- Add CI test job with Emacs batch load and byte-compile - Fix settings-file variable check in init.el - Fix extra parenthesis in init-neotree.el - Add missing projectile dependencies in neotree and web-mode - Fix add-hook usage in init-icons.el - Add hydra dependency in init-ivy.el - Standardize header style in init-company.el
This commit is contained in:
@@ -3,13 +3,45 @@ name: git-sync-with-mirror
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
git-sync:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 10
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Emacs
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y emacs-nox
|
||||||
|
|
||||||
|
- name: Setup environment
|
||||||
|
run: |
|
||||||
|
cp .env.example .env
|
||||||
|
|
||||||
|
- name: Load configuration
|
||||||
|
run: |
|
||||||
|
emacs --batch -l init.el
|
||||||
|
|
||||||
|
- name: Byte compile configuration
|
||||||
|
run: |
|
||||||
|
emacs --batch -f batch-byte-compile init.el modules/*.el
|
||||||
|
|
||||||
|
git-sync:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
timeout-minutes: 15
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: git-sync
|
- name: git-sync
|
||||||
env:
|
env:
|
||||||
git_sync_source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
git_sync_source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
||||||
@@ -19,8 +51,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
||||||
source_branch: "master"
|
source_branch: "master"
|
||||||
destination_repo: ssh://git@c.fridu.us/software/emacs-personal.git
|
|
||||||
destination_branch: "master"
|
destination_branch: "master"
|
||||||
|
destination_repo: ssh://git@c.fridu.us/software/emacs-personal.git
|
||||||
source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
|
source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
|
||||||
destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}
|
destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}
|
||||||
|
|
||||||
@@ -33,7 +65,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
source_repo: git@git.fridu.us:heckyel/emacs-personal.git
|
||||||
source_branch: "master"
|
source_branch: "master"
|
||||||
destination_repo: git@git.sr.ht:~heckyel/emacs-personal
|
|
||||||
destination_branch: "master"
|
destination_branch: "master"
|
||||||
|
destination_repo: git@git.sr.ht:~heckyel/emacs-personal
|
||||||
source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
|
source_ssh_private_key: ${{ secrets.GIT_SYNC_SOURCE_SSH_PRIVATE_KEY }}
|
||||||
destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}
|
destination_ssh_private_key: ${{ secrets.GIT_SYNC_DESTINATION_SSH_PRIVATE_KEY }}
|
||||||
|
|||||||
4
init.el
4
init.el
@@ -51,6 +51,8 @@
|
|||||||
gc-cons-percentage 0.1))))
|
gc-cons-percentage 0.1))))
|
||||||
|
|
||||||
;;; Modules directory
|
;;; Modules directory
|
||||||
|
(if noninteractive
|
||||||
|
(setq user-emacs-directory default-directory))
|
||||||
(push (concat user-emacs-directory "modules") load-path)
|
(push (concat user-emacs-directory "modules") load-path)
|
||||||
|
|
||||||
;;;------------------------------
|
;;;------------------------------
|
||||||
@@ -135,7 +137,7 @@
|
|||||||
;;; Settings
|
;;; Settings
|
||||||
(setq settings-file (expand-file-name "settings.el" user-emacs-directory))
|
(setq settings-file (expand-file-name "settings.el" user-emacs-directory))
|
||||||
;;; Loads settings file
|
;;; Loads settings file
|
||||||
(when (file-exists-p custom-file)
|
(when (file-exists-p settings-file)
|
||||||
(load settings-file))
|
(load settings-file))
|
||||||
|
|
||||||
;; enable erase-buffer command
|
;; enable erase-buffer command
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
;;; init-company.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
;;; init-company.el --- .Emacs Configuration -*- lexical-binding: t -*-
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;; Company es un famework de Emacs para el completado de texto.
|
;; Company is a framework for text completion in Emacs.
|
||||||
|
|
||||||
;;; code:
|
;;; Code:
|
||||||
(use-package company
|
(use-package company
|
||||||
:defer 5
|
:defer 5
|
||||||
:diminish
|
:diminish
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
(global-company-mode t))
|
(global-company-mode t))
|
||||||
|
|
||||||
(use-package company-quickhelp
|
(use-package company-quickhelp
|
||||||
:ensure t
|
|
||||||
:after company
|
:after company
|
||||||
:config
|
:config
|
||||||
(company-quickhelp-mode 1))
|
(company-quickhelp-mode 1))
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
;;---------------------------------
|
;;---------------------------------
|
||||||
(when (display-graphic-p)
|
(when (display-graphic-p)
|
||||||
(unless (member "all-the-icons" (font-family-list))
|
(unless (member "all-the-icons" (font-family-list))
|
||||||
(setq neotree-mode-hook 'all-the-icons-install-fonts))))
|
(add-hook 'neotree-mode-hook #'all-the-icons-install-fonts))))
|
||||||
|
|
||||||
;; fix performace
|
;; fix performace
|
||||||
(setq inhibit-compacting-font-caches t)
|
(setq inhibit-compacting-font-caches t)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
;; hydra
|
;; hydra
|
||||||
(use-package hydra
|
(use-package hydra
|
||||||
:pin "MELPA"
|
:pin "MELPA"
|
||||||
|
:after ivy
|
||||||
:config (hydra-add-font-lock))
|
:config (hydra-add-font-lock))
|
||||||
|
|
||||||
(use-package swiper
|
(use-package swiper
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
(use-package neotree
|
(use-package neotree
|
||||||
:ensure t
|
:ensure t
|
||||||
|
:after projectile
|
||||||
:pin "MELPA"
|
:pin "MELPA"
|
||||||
:commands (neotree-show
|
:commands (neotree-show
|
||||||
neotree-hide
|
neotree-hide
|
||||||
@@ -69,8 +70,7 @@
|
|||||||
(when (and (require 'neotree nil t)
|
(when (and (require 'neotree nil t)
|
||||||
(fboundp 'neo-buffer--insert-root-entry)
|
(fboundp 'neo-buffer--insert-root-entry)
|
||||||
(fboundp 'shrink-root-entry))
|
(fboundp 'shrink-root-entry))
|
||||||
(advice-add #'neo-buffer--insert-root-entry :override #'shrink-root-entry))
|
(advice-add #'neo-buffer--insert-root-entry :override #'shrink-root-entry)))
|
||||||
)
|
|
||||||
|
|
||||||
(defun neotree-project-dir-toggle ()
|
(defun neotree-project-dir-toggle ()
|
||||||
"Open NeoTree using the project root, using find-file-in-project or the current buffer directory."
|
"Open NeoTree using the project root, using find-file-in-project or the current buffer directory."
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(use-package web-mode
|
(use-package web-mode
|
||||||
|
:after projectile
|
||||||
:pin "MELPA"
|
:pin "MELPA"
|
||||||
:mode (("\\.html?\\'" . web-mode)
|
:mode (("\\.html?\\'" . web-mode)
|
||||||
("\\.djhtml\\'" . web-mode)
|
("\\.djhtml\\'" . web-mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user