Skip to content

Commit

Permalink
chore(ci): split CI jobs by OS to separate workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 22, 2023
1 parent 665681d commit 15c1c17
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 122 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CI Linux

on:
push:
pull_request:
workflow_dispatch:
# Run weekly
schedule:
- cron: "0 0 * * 0"

jobs:
ci-linux:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
emacs_version:
- 28.2
- 29.1
steps:
- uses: actions/checkout@v4
- uses: purcell/setup-emacs@master
with:
version: ${{ matrix.emacs_version }}
# Install dependencies for vterm...
- name: Install dependency needed for some Emacs packages (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install -y libtool-bin cmake tree
- name: Show Emacs version
run: |
EMACS_VERSION=$(emacs --version)
echo $EMACS_VERSION
echo "EMACS_VERSION=$(echo $EMACS_VERSION | head -n1 | sed -E 's/GNU Emacs ([^ ]*).*/\1/')" >> "$GITHUB_ENV"
- name: Running Emacs
run: |
ln -s "$(pwd)" "../.emacs.d"
echo "Enabling all MinEmacs modules"
echo "Running Emacs with MinEmacs configuration"
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
make ci | tee /tmp/minemacs-output
EMACS_EXIT_CODE=$?
if [[ $EMACS_EXIT_CODE == 0 ]]; then
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero code ${EMACS_EXIT_CODE}"
fi
WARNINGS=$(cat /tmp/minemacs-output | grep Warning | sed -E 's/^(.*\.el): Warning/- \*\*\1\*\*/' | sed -E 's/^Warning ([^:]*)/- \*\*\1\*\*/')
LOAD_ERRORS=$(cat /tmp/minemacs-output | grep -E "(Cannot (open )?load)|(Not found)" | sed 's/^/- /')
ELISP_ERRORS=$(cat /tmp/minemacs-output | awk -F': ' '/^Debugger entered--Lisp error: / { print "- **" $1 "**: `" $2 "`"; print "```elisp"; while (getline && match($0, "^[[:space:]]{2}")) print $0; print "```"}' )
echo -e "# MinEmacs report ($EMACS_VERSION)\n" >> $GITHUB_STEP_SUMMARY
if [[ ! -z "$LOAD_ERRORS" ]]; then
echo -e "## Loading errors\n$LOAD_ERRORS\n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$ELISP_ERRORS" ]]; then
echo -e "## Emacs Lisp errors\n$ELISP_ERRORS\n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$WARNINGS" ]]; then
echo -e "## Warnings\n$WARNINGS" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$LOAD_ERRORS" ]] || [[ ! -z "$ELISP_ERRORS" ]] || [[ ! -z "$EMACS_EXIT_CODE" ]]; then exit 1; fi
50 changes: 50 additions & 0 deletions .github/workflows/ci-macos.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI MacOS

on:
push:
pull_request:
workflow_dispatch:
# Run weekly
schedule:
- cron: "0 0 * * 0"

jobs:
ci-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Emacs (MacOS)
run: |
brew install emacs
- name: Show Emacs version
run: |
EMACS_VERSION=$(emacs --version)
echo $EMACS_VERSION
echo "EMACS_VERSION=$(echo $EMACS_VERSION | head -n1 | sed -E 's/GNU Emacs ([^ ]*).*/\1/')" >> "$GITHUB_ENV"
- name: Running Emacs
run: |
ln -s "$(pwd)" "../.emacs.d"
echo "Enabling all MinEmacs modules"
echo "Running Emacs with MinEmacs configuration"
MINEMACSDIR=.github/workflows/scripts/minemacs-all.d/
make ci | tee /tmp/minemacs-output
EMACS_EXIT_CODE=$?
if [[ -z "$EMACS_EXIT_CODE" ]]; then
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero code ${EMACS_EXIT_CODE}"
fi
WARNINGS=$(cat /tmp/minemacs-output | grep Warning | sed -E 's/^(.*\.el): Warning/- \*\*\1\*\*/' | sed -E 's/^Warning ([^:]*)/- \*\*\1\*\*/')
LOAD_ERRORS=$(cat /tmp/minemacs-output | grep -E "(Cannot (open )?load)|(Not found)" | sed 's/^/- /')
ELISP_ERRORS=$(cat /tmp/minemacs-output | awk -F': ' '/^Debugger entered--Lisp error: / { print "- **" $1 "**: `" $2 "`"; print "```elisp"; while (getline && match($0, "^[[:space:]]{2}")) print $0; print "```"}' )
echo -e "# MinEmacs report ($EMACS_VERSION)\n" >> $GITHUB_STEP_SUMMARY
if [[ ! -z "$LOAD_ERRORS" ]]; then
echo -e "## Loading errors\n$LOAD_ERRORS\n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$ELISP_ERRORS" ]]; then
echo -e "## Emacs Lisp errors\n$ELISP_ERRORS\n" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$WARNINGS" ]]; then
echo -e "## Warnings\n$WARNINGS" >> $GITHUB_STEP_SUMMARY
fi
if [[ ! -z "$LOAD_ERRORS" ]] || [[ ! -z "$ELISP_ERRORS" ]] || [[ ! -z "$EMACS_EXIT_CODE" ]]; then exit 1; fi
26 changes: 26 additions & 0 deletions .github/workflows/ci-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI Windows

on:
push:
pull_request:
workflow_dispatch:
# Run weekly
schedule:
- cron: "0 0 * * 0"

jobs:
ci-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Emacs (Windows)
run: |
choco install emacs
- name: Show Emacs version
run: |
emacs --version
- name: Running Emacs
run: |
$env:HOME = "D:\a\minemacs\"
$env:MINEMACSDIR = "D:\a\minemacs\.github\workflows\scripts\minemacs-all.d\"
emacs --no-window-system --batch --script .github\workflows\scripts\ci-init.el
117 changes: 0 additions & 117 deletions .github/workflows/ci.yaml

This file was deleted.

13 changes: 8 additions & 5 deletions README.org
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
* MinEmacs

[[https://github.com/abougouffa/minemacs/actions/workflows/ci.yaml][https://github.com/abougouffa/minemacs/actions/workflows/ci.yaml/badge.svg]]
[[https://github.com/abougouffa/minemacs/actions/workflows/ci-linux.yaml][https://github.com/abougouffa/minemacs/actions/workflows/ci-linux.yaml/badge.svg]]
[[https://github.com/abougouffa/minemacs/actions/workflows/ci-macos.yaml][https://github.com/abougouffa/minemacs/actions/workflows/ci-macos.yaml/badge.svg]]
[[https://github.com/abougouffa/minemacs/actions/workflows/ci-windows.yaml][https://github.com/abougouffa/minemacs/actions/workflows/ci-windows.yaml/badge.svg]]

*MinEmacs* is a lightweight Emacs configuration framework. The keybinding is
inspired by Doom Emacs.
Expand Down Expand Up @@ -54,10 +56,11 @@ packages.

*** ⚠ Important note
Please note that I'm using a fresh Emacs 29 built from source on a Manjaro Linux
system. I have enabled basic [[https://github.com/abougouffa/minemacs/actions/workflows/ci.yaml][Github CI actions]] to automatically test running
Emacs on Ubuntu Linux (Emacs 28 and 29), MacOS (Emacs 29) and Windows (Emacs
28). These actions ensure that MinEmacs is "runnable" on these systems, however,
more testing should be done to validate the configuration on these systems.
system. I have enabled basic [[https://github.com/abougouffa/minemacs/actions/workflows][Github CI actions]] to automatically test running
Emacs on [[https://github.com/abougouffa/minemacs/actions/workflows/ci-linux.yaml][Ubuntu Linux (Emacs 28 and 29)]], [[https://github.com/abougouffa/minemacs/actions/workflows/ci-macos.yaml][MacOS (Emacs 29)]] and [[https://github.com/abougouffa/minemacs/actions/workflows/ci-windows.yaml][Windows (Emacs
28)]]. These actions ensure that MinEmacs is "runnable" with all modules enabled
on these systems. However, more testing should be done to validate the
configuration on systems other than Linux.

I'm trying to support at least Emacs 28.2, so [[file:core/me-backports-29.el][I back port some of the new
functions/macros I use to Emacs 28]]. Furthermore, for Emacs 28 and earlier,
Expand Down

0 comments on commit 15c1c17

Please sign in to comment.