Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Tests macOS and Windows #871

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
57 changes: 47 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,60 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
emacs_version:
os: [ubuntu-latest, macos-latest, windows-latest]
emacs-version:
- 27.2
- 28.2
- 29.3
- snapshot
- 29.4
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
exclude:
- os: macos-latest
emacs-version: 27.2

steps:
- uses: purcell/setup-emacs@master
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

- uses: emacs-eask/setup-eask@master
with:
version: ${{ matrix.emacs_version }}
version: 'snapshot'

- uses: actions/checkout@v3
- name: Install dependencies
- uses: actions/checkout@v4

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: sudo apt install pandoc aspell
- name: Run tests

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install pandoc aspell

- name: Run tests (Unix)
if: runner.os == 'Linux' || runner.os == 'macOS'
run: |
make clean
make build
make test-unix

- name: Run tests (Windows)
if: runner.os == 'Windows'
run: |
make clean
make test
make build
make test-windows
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
*.elc
index.text
*~

/.eask
/dist
20 changes: 20 additions & 0 deletions Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
(package "markdown-mode"
"2.7alpha"
"Major mode for Markdown-formatted text")

(website-url "https://jblevins.org/projects/markdown-mode/")
(keywords "markdown" "github flavored markdown" "itex")

(package-file "markdown-mode.el")

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

(source 'gnu)

(depends-on "emacs" "27.1")

(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432

(add-hook 'eask-before-compile-hook
(lambda ()
(setq byte-compile-error-on-warn t)))
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
EMACS=emacs
EASK=eask

PACKAGE=markdown-mode

Expand All @@ -16,25 +17,25 @@ all: $(COMPILED)

.PHONY: dist test

test:
SELECTOR=$(SELECTOR)
export SELECTOR
make -C tests test
build:
$(EASK) package
$(EASK) install

test-unix:
$(EASK) compile
$(EASK) test ert ./tests/markdown-test.el
$(EASK) lint checkdoc

test-windows:
$(EASK) compile
#$(EASK) test ert ./tests/markdown-test.el
$(EASK) lint checkdoc

clean:
rm -f $(COMPILED)
make -C tests clean
$(EASK) clean all

dist:
DIR=$$(mktemp -d -t "$(PACKAGE)"); \
DESTDIR="$$DIR/$(PACKAGE)-$(VERSION)"; \
mkdir -p $$DESTDIR; \
cp -a $(SOURCE) $$DESTDIR; \
mkdir -p $$DESTDIR/tests; \
cp -a $(TEST_FILES) $$DESTDIR/tests; \
tar zcf $(CURDIR)/$(PACKAGE)-$(VERSION).tar.gz -C $$DIR .; \
rm -r $$DIR; \
echo "$(PACKAGE)-$(VERSION).tar.gz has been created"
$(EASK) package

update: $(COMPILED)
cp -a $(SOURCE) $(COMPILED) $(HOME)/.emacs.d/site-lisp
6 changes: 3 additions & 3 deletions tests/markdown-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ the opening bracket of [^2], and then subsequent functions would kill [^2])."

(ert-deftest test-markdown-do/jump-wiki-link ()
"Test `markdown-do' jumps to wiki links"
(with-current-buffer (find-file-noselect "wiki/pr666/jump_wiki_link.md")
(with-current-buffer (find-file-noselect "tests/wiki/pr666/jump_wiki_link.md")
(let ((markdown-enable-wiki-links t))
(goto-char 3)
(markdown-do)
Expand All @@ -1581,7 +1581,7 @@ the opening bracket of [^2], and then subsequent functions would kill [^2])."

(ert-deftest test-markdown-do/wiki-link-in-table ()
"Test `markdown-do' jumps to markdown links"
(with-current-buffer (find-file-noselect "wiki/pr666/wiki_link_in_table.md")
(with-current-buffer (find-file-noselect "tests/wiki/pr666/wiki_link_in_table.md")
(let ((markdown-enable-wiki-links t))
;; alignment
(markdown-do)
Expand Down Expand Up @@ -7278,7 +7278,7 @@ Detail: https://github.com/jrblevin/markdown-mode/pull/590"
Detail: https://github.com/jrblevin/markdown-mode/issues/737"
(let ((markdown-command #'markdown-command-identity))
(let ((eww-auto-rename-buffer 'title))
(should (markdown-live-preview-window-eww "Markdown.md"))))))
(should (markdown-live-preview-window-eww "tests/Markdown.md"))))))

;;; Tests for imenu

Expand Down