-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from taku0/add_linter
Add GitHub Actions for tests and linters
- Loading branch information
Showing
12 changed files
with
158 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
((emacs-lisp-mode . ((package-lint-main-file . "kotlin-mode.el") | ||
(eval . (checkdoc-minor-mode)) | ||
(indent-tabs-mode . nil) | ||
(fill-column . 80) | ||
(tab-width . 8) | ||
(sentence-end-double-space . t) | ||
(emacs-lisp-docstring-fill-column . 75) | ||
(elisp-lint-indent-specs . ((kotlin-mode--save-mark-and-excursion . 0)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Run Tests | ||
|
||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{matrix.version == 'snapshot'}} | ||
|
||
strategy: | ||
matrix: | ||
# Cask does't support Emacs 24. | ||
version: ['25.1', '25.2', '25.3', '26.1', '26.2', '26.3', '27.1', '27.2', '28.1', '28.2', 'snapshot'] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: purcell/setup-emacs@master | ||
with: | ||
version: ${{ matrix.version }} | ||
- name: Run linters | ||
run: ./scripts/run_linter.sh | ||
- name: Run tests | ||
run: ./scripts/run_test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ | |
|
||
;; Author: Shodai Yokoyama ([email protected]) | ||
;; taku0 (http://github.com/taku0) | ||
;; Keywords: languages | ||
;; Package-Requires: ((emacs "24.3")) | ||
|
||
;; This program is free software; you can redistribute it and/or modify | ||
;; it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# A little wrapper for Cask. Used in Makefile. | ||
# If ${CASK} is executable, use it. | ||
# Otherwise, download the Cask to .cask/cask if not exists, then execute it. | ||
|
||
if command -v "${CASK}" > /dev/null | ||
then | ||
"${CASK}" "$@" | ||
elif command -v .cask/cask/bin/cask > /dev/null | ||
then | ||
.cask/cask/bin/cask "$@" | ||
else | ||
mkdir -p .cask || exit 1 | ||
git clone --depth 1 https://github.com/cask/cask.git .cask/cask || exit 1 | ||
chmod a+x .cask/cask/bin/cask || exit 1 | ||
.cask/cask/bin/cask "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# Run linter. Used in Makefile. | ||
|
||
if ! [ -d ".cask/$(./scripts/invoke_cask.sh eval '(princ emacs-version)')/elpa/elisp-lint-"* ] | ||
then | ||
./scripts/invoke_cask.sh install || exit 1 | ||
fi | ||
|
||
./scripts/invoke_cask.sh emacs --version || exit 1 | ||
rm -f *.elc test/*.elc || exit 1 | ||
rm -f *-autoloads.el || exit 1 | ||
./scripts/invoke_cask.sh emacs --batch -Q \ | ||
-l elisp-lint.el \ | ||
--eval '(setq elisp-lint--debug t)' \ | ||
-f elisp-lint-files-batch \ | ||
*.el || exit 1 | ||
rm -f *.elc test/*.elc || exit 1 | ||
rm -f *-autoloads.el || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
# Run linter in Docker. Used in Makefile. | ||
|
||
# Cask does't support Emacs 24. | ||
for version in 28 27 26 25 # 24 | ||
do | ||
docker \ | ||
run \ | ||
--rm \ | ||
--volume="$(pwd)":/src \ | ||
--user="$(id -u):$(id -g)" \ | ||
--workdir="/src" \ | ||
--env=ELDEV_DIR=/src/.eldev \ | ||
--env=HOME=/tmp \ | ||
silex/emacs:${version} \ | ||
bash -c "/src/scripts/run_linter.sh" \ | ||
|| exit 1 | ||
done | ||
|
||
echo "done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
# Run tests. Used in Makefile. | ||
|
||
if ! [ -d ".cask/$(./scripts/invoke_cask.sh eval '(princ emacs-version)')/elpa/ert-runner-"* ] | ||
then | ||
./scripts/invoke_cask.sh install || exit 1 | ||
fi | ||
|
||
./scripts/invoke_cask.sh emacs --version || exit 1 | ||
./scripts/invoke_cask.sh emacs --batch -q \ | ||
--eval "(add-to-list 'load-path \"$(readlink -f .)\")" \ | ||
--eval "(add-to-list 'load-path \"$(readlink -f .)/test\")" \ | ||
-f batch-byte-compile \ | ||
*.el test/*.el || exit 1 | ||
./scripts/invoke_cask.sh exec ert-runner -L . -L test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
# Run tests in Docker. Used in Makefile. | ||
|
||
# Cask does't support Emacs 24. | ||
for version in 28 27 26 25 # 24 | ||
do | ||
rm -f *.elc test/*.elc | ||
rm -f *-autoloads.el | ||
docker \ | ||
run \ | ||
--rm \ | ||
--volume="$(pwd)":/src \ | ||
--user="$(id -u):$(id -g)" \ | ||
--workdir="/src" \ | ||
--env=ELDEV_DIR=/src/.eldev \ | ||
--env=HOME=/tmp \ | ||
silex/emacs:${version} \ | ||
bash -c "/src/scripts/run_test.sh" \ | ||
|| exit 1 | ||
done | ||
|
||
echo "done" |