From 37412b6bf3b6f607f2620476ca8fd158b43f704b Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 12 Sep 2023 23:10:09 -0700 Subject: [PATCH] test: Build with Eask --- .github/workflows/test.yml | 49 ++++++++++++++++++++++++++++++++++++++ .gitignore | 2 ++ Eask | 19 +++++++++++++++ Makefile | 36 +++++++++------------------- 4 files changed, 81 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 Eask diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..1e79dcc --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: CI + +on: + push: + paths-ignore: + - '**/*.md' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + emacs-version: + - 26.3 + - 27.2 + - 28.2 + - 29.1 + experimental: [false] + include: + - os: ubuntu-latest + emacs-version: snapshot + experimental: true + - os: macos-latest + emacs-version: snapshot + experimental: true + - os: windows-latest + emacs-version: snapshot + experimental: true + steps: + - uses: jcs090218/setup-emacs@master + with: + version: ${{ matrix.emacs-version }} + + - uses: emacs-eask/setup-eask@master + with: + version: 'snapshot' + + - uses: actions/checkout@v4 + + - name: Run make + run: make all diff --git a/.gitignore b/.gitignore index 80d903e..7de5758 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *-autoloads.el *.elc .cask +.eask +/dist composer.lock vendor/* diff --git a/Eask b/Eask new file mode 100644 index 0000000..2c04d2f --- /dev/null +++ b/Eask @@ -0,0 +1,19 @@ +(package "composer" + "0.2.0" + "Interface to PHP Composer") + +(website-url "https://github.com/emacs-php/composer.el") +(keywords "tools" "php" "dependency" "manager") + +(package-file "composer.el") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(source 'gnu) +(source 'melpa) + +(depends-on "emacs" "25.1") +(depends-on "seq") +(depends-on "php-runtime") + +(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432 diff --git a/Makefile b/Makefile index 777b2ab..2d60e8a 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,20 @@ EMACS ?= emacs CASK ?= cask -ELS = composer.el -AUTOLOADS = composer-autoloads.el -ELCS = $(ELS:.el=.elc) +EASK ?= eask -.el.elc: .cask - $(EMACS) -Q -batch -L . --eval \ - "(let ((default-directory (expand-file-name \".cask\" default-directory))) \ - (require 'package) \ - (normal-top-level-add-subdirs-to-load-path))" \ - -f package-initialize -f batch-byte-compile $< +install: + $(EASK) package + $(EASK) install -.cask: Cask - $(CASK) +compile: + $(EASK) compile -all: clean autoloads $(ELCS) +all: clean autoloads install compile -autoloads: $(AUTOLOADS) - -$(AUTOLOADS): $(ELCS) - $(EMACS) -Q -batch -L . --eval \ - "(progn \ - (require 'package) \ - (normal-top-level-add-subdirs-to-load-path) \ - (package-generate-autoloads \"composer\" default-directory))" +autoloads: + $(EASK) generate autoloads clean: - -rm -f $(ELCS) $(AUTOLOADS) - -clobber: clean - -rm -f .cask + $(EASK) clean all -.PHONY: all autoloads clean clobber +.PHONY: all autoloads clean