Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
ci: Build with Eask
  • Loading branch information
jcs090218 committed Sep 11, 2023
commit f6496ae81b2df5312d0767323e79b95eb3da6d6b
20 changes: 13 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,28 @@ on:
paths-ignore:
- '**/*.md'
- 'etc/*'
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
timeout-minutes: 3
strategy:
matrix:
emacs_version:
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
- "26.1"
- "26.3"
- "27.1"
- "27.2"
- "28.1"
- "28.2"
- "29.1"
- release-snapshot
- snapshot
include:
- emacs_version: snapshot
Expand All @@ -30,16 +36,16 @@ jobs:
with:
python-version: '3.11'
architecture: 'x64'
- uses: purcell/setup-emacs@master
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs_version }}
- uses: conao3/setup-cask@master
- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'
- uses: actions/checkout@v4
- name: Run tests
if: matrix.allow_failure != true
run: 'make .cask test'
run: 'make .eask test'
- name: Run tests (allow failure)
if: matrix.allow_failure == true
run: 'make .cask test || true'
run: 'make .eask test || true'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
*~
.dir-locals-2.el
/.cask/*
/.eask/*
/.keg/*
/dist
/.php-cs-fixer.cache
php-mode-autoloads.el
php_manual_en.json
36 changes: 36 additions & 0 deletions Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
(package "php-mode"
"1.25.0"
"Major mode for editing PHP code")

(website-url "https://github.com/emacs-php/php-mode")
(keywords "languages" "php")

(package-file "lisp/php-mode.el")
(files
"lisp/php.el"
"lisp/php-complete.el"
"lisp/php-defs.el"
"lisp/php-face.el"
"lisp/php-format.el"
"lisp/php-project.el"
"lisp/php-local-manual.el"
"lisp/php-ide-phpactor.el"
"lisp/php-ide.el"
"lisp/php-mode-debug.el")

(script "test" "echo \"Error: no test specified\" && exit 1")

(source 'melpa)
(source 'gnu)

(depends-on "emacs" "26.1")

(development
(depends-on "phpactor")
(depends-on "pkg-info")
(depends-on "projectile")
(depends-on "smart-jump")
(depends-on "shut-up")
)

(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432
41 changes: 9 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
EMACS ?= emacs
CASK ?= cask
ELS = lisp/php.el
ELS += lisp/php-align.el
ELS += lisp/php-complete.el
ELS += lisp/php-defs.el
ELS += lisp/php-face.el
ELS += lisp/php-flymake.el
ELS += lisp/php-format.el
ELS += lisp/php-ide-phpactor.el
ELS += lisp/php-ide.el
ELS += lisp/php-local-manual.el
ELS += lisp/php-mode-debug.el
ELS += lisp/php-mode.el
ELS += lisp/php-project.el
AUTOLOADS = php-mode-autoloads.el
ELCS = $(ELS:.el=.elc)
EASK ?= eask

%.elc: %.el
$(EMACS) --batch -L lisp/ -f batch-byte-compile $<
compile:
$(EASK) compile

all: autoloads $(ELCS) authors

Expand All @@ -34,19 +20,14 @@ AUTHORS.md: etc/git/AUTHORS.md.in .mailmap
&& printf "FINISHED\n" ; ) \
|| printf "FAILED (non-fatal)\n"

autoloads: $(AUTOLOADS)
autoloads:
$(EASK) generate autoloads

$(AUTOLOADS): $(ELS)
$(EMACS) --batch -L lisp/ --eval \
"(let ((user-emacs-directory default-directory)) \
(require 'package) \
(package-generate-autoloads \"php-mode\" (expand-file-name \"lisp\")))"

.cask: Cask
$(CASK) install
.eask: Eask
$(EASK) install

clean:
rm -f $(ELCS) $(AUTOLOADS)
$(EASK) clean all

# Perform any operations that will be useful for developers
# who contribute to PHP Mode.
Expand All @@ -66,10 +47,6 @@ dev:
# for an example of using a script like this with the 'git bisect run'
# command.
test: clean all
touch tests/project/1/.git
$(EMACS) --batch -l lisp/php-mode-autoloads.el --eval \
"(let ((default-directory (expand-file-name \".cask\" default-directory))) \
(normal-top-level-add-subdirs-to-load-path))" \
-l tests/php-mode-test.el -f ert-run-tests-batch-and-exit
$(EASK) test ert ./tests/php-mode-test.el

.PHONY: all authors autoloads clean test
1 change: 1 addition & 0 deletions tests/php-mode-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ as a keyword."
(ert-deftest php-project-root ()
"Test for detection `php-project-root' by directory."
(dolist (root (mapcar #'car php-project-available-root-files))
(skip-unless (eq system-type windows-nt)) ; TODO: Make test compatible to Windows!
(with-php-mode-test ("project/1/src/functions.php")
(let ((php-project-root root))
(should (string= (expand-file-name "project/1/" php-mode-test-dir)
Expand Down