-
Notifications
You must be signed in to change notification settings - Fork 17
116 lines (112 loc) · 4.84 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: MinEmacs modules check
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"
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
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero 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 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" ]]; then exit 1; fi
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"
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
echo "Emacs exited successfully"
else
echo "Emacs exited with non-zero 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 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" ]]; then exit 1; fi
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:MINEMACS_VERBOSE = 1
$env:MINEMACS_CI = 1
emacs --no-window-system --batch --script init.el