Skip to content

Commit

Permalink
chore(ci): use an independent initialization script for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 22, 2023
1 parent e1286b3 commit a6c7c7e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MinEmacs modules check
name: CI

on:
push:
Expand Down Expand Up @@ -36,10 +36,9 @@ jobs:
run: |
ln -s "$(pwd)" "../.emacs.d"
echo "Enabling all MinEmacs modules"
mkdir ../.minemacs.d/
cp .github/workflows/test-confs/modules-all.el ../.minemacs.d/modules.el
echo "Running Emacs with MinEmacs configuration"
if MINEMACS_CI=1 HOME=$GITHUB_WORKSPACE/.. emacs -nw --batch --script init.el 2>&1 | tee /tmp/minemacs-output; then
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
if make ci | tee /tmp/minemacs-output; then
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero code $?"
Expand Down Expand Up @@ -75,10 +74,9 @@ jobs:
run: |
ln -s "$(pwd)" "../.emacs.d"
echo "Enabling all MinEmacs modules"
mkdir ../.minemacs.d/
cp .github/workflows/test-confs/modules-all.el ../.minemacs.d/modules.el
echo "Running Emacs with MinEmacs configuration"
if MINEMACS_CI=1 HOME=$GITHUB_WORKSPACE/.. emacs -nw --batch --script init.el 2>&1 | tee /tmp/minemacs-output; then
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
if make ci | tee /tmp/minemacs-output; then
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero code $?"
Expand Down Expand Up @@ -111,6 +109,5 @@ jobs:
- name: Running Emacs
run: |
$env:HOME = "D:\a\minemacs\"
$env:MINEMACS_VERBOSE = 1
$env:MINEMACS_CI = 1
emacs --no-window-system --batch --script init.el
$env:MINEMACSDIR = "D:\a\minemacs\.github\workflows\scripts\minemacs-all.d\"
emacs --no-window-system --batch --script .github\workflows\scripts\ci-init.el
32 changes: 32 additions & 0 deletions .github/workflows/scripts/ci-init.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
;; ci-init.el --- This file is used as an init script in the CI -*- lexical-binding: t; -*-

;; Copyright (C) 2023 Abdelhak Bougouffa

;; Author: Abdelhak Bougouffa (concat "abougouffa" "@" "fedora" "project" "." "org")

;;; Commentary:

;;; Code:

(setenv "MINEMACS_DEBUG" "1")
(setenv "MINEMACS_VERBOSE" "1")
(setenv "MINEMACS_NOT_LAZY" "1")

(message "Running MinEmacs in CI mode, loading all packages.")

(let ((root-dir (file-name-directory ;; ./../../../ -> minemacs-root-dir
(directory-file-name
(file-name-directory
(directory-file-name
(file-name-directory
(directory-file-name
(file-name-directory load-file-name)))))))))
(message "Calculated root directory is \"%s\"" default-directory)
(message "Loading \"early-init.el\"")
(load (expand-file-name "early-init.el" root-dir))

(message "Loading \"init.el\"")
(load (expand-file-name "init.el" root-dir)))

(message "Running MinEmacs in CI mode, loading all packages.")
(mapc #'require minemacs-configured-packages)
File renamed without changes.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ update:

cloc:
cloc --match-f='\.el$$' init.el early-init.el elisp/ modules/ core/

ci:
HOME=$(PWD)/.. $(EMACS) -nw --batch --script .github/workflows/test-confs/ci-init.el 2>&1

0 comments on commit a6c7c7e

Please sign in to comment.