Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNDRmac committed Mar 29, 2020
1 parent 93eb978 commit 1af6087
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build

on: push

jobs:
build:
runs-on: macOS-latest

strategy:
fail-fast: false

matrix:
emacs-version:
- '26.1'
- '26.2'
- '26.3'
- 'snapshot'
include:
- emacs-version: snapshot
allow_failure: true

steps:
- name: Checkout Code
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Setup GNU Emacs
uses: purcell/setup-emacs@master
with:
version: ${{ matrix:emacs-version }}

- name: Run tests
if: matrix.allow_failure != true
run: ln -s $GITHUB_WORKSPACE $HOME/.emacs.d && ./run-tests.sh --debug

- name: Run tests (snapshot)
if: matrix.allow_failure == true
run: ln -s $GITHUB_WORKSPACE $HOME/.emacs.d && (./run-tests.sh --debug || true)

- name: Run Shell script analyzis tool
run: shellcheck ./run-tests.sh
31 changes: 31 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh -eu

echo "Emacs initial startup..."

EMACS=${EMACS:-emacs}

command -v "$EMACS" >/dev/null || {
>&2 echo "Can't find GNU Emacs in your PATH"
exit 1
}

[ -n "${1-}" ] && {
[ "$1" = -d ] || [ "$1" = --debug ] && {
shift
export DEBUG=1
}
}

${EMACS} \
--no-window-system \
--batch \
--eval '(let ((debug-on-error t)
(url-show-status nil)
(user-emacs-directory default-directory)
(package-user-dir (expand-file-name (concat "elpa-" emacs-version)))
(user-init-file (expand-file-name "init.el"))
(load-path (delq default-directory load-path)))
(load-file user-init-file)
(run-hooks (quote after-init-hook)))'

echo "Startup successful!"

0 comments on commit 1af6087

Please sign in to comment.