Skip to content

test: Add activation test for standalone CLI #3

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

Open
wants to merge 2 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
58 changes: 58 additions & 0 deletions .github/workflows/activation-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Activation CLI

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

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

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
emacs-version:
- 27.2
- 28.2
- snapshot
include:
- emacs-version: 'snapshot'
allow_failure: true
steps:
- uses: jcs090218/setup-emacs@master
with:
version: ${{ matrix.emacs-version }}

# Remove expired DST Root CA X3 certificate. Workaround for
# https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 bug on Emacs 27.2.
# https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-1126671598
- name: Workaround for Emacs 27.2's Windows build from GNU FTP
if: ${{ runner.os == 'Windows' && matrix.emacs-version == '27.2' }}
run: |
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13
gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item

- uses: emacs-eask/setup-eask@master
with:
version: 'snapshot'

- uses: actions/checkout@v3

- name: Grant execution permission
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: chmod -R 777 ./tests/fixtures/dummy-package/

- name: Run tests
shell: bash
run: |
./tests/fixtures/dummy-package/run.sh
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.cask
/.eask
/dist
/.elsa
/tests/.elsa
*.elc
Expand Down
10 changes: 10 additions & 0 deletions tests/fixtures/dummy-package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.eask
/dist

/.elsa
/tests/.elsa

*.elc
report.json
.dir-locals.el
.env
17 changes: 17 additions & 0 deletions tests/fixtures/dummy-package/Eask
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(package "dummy-package"
"0.1.0"
"Dummy package test")

(package-file "dummy-package.el")

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

(source 'gnu)
(source 'melpa)

(depends-on "emacs" "26.1")
(depends-on "dash" "2.14")
(depends-on "seq")
(depends-on "f")
(depends-on "trinary")
(depends-on "lsp-mode")
37 changes: 37 additions & 0 deletions tests/fixtures/dummy-package/dummy-package.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
;;; dummy-package.el --- Dummy package main file -*- lexical-binding: t; -*-

;; Copyright (C) 2023 Shen, Jen-Chieh

;; Author: Shen, Jen-Chieh <[email protected]>
;; Maintainer: Shen, Jen-Chieh <[email protected]>
;; URL: https://github.com/emacs-elsa/dummy-package
;; Version: 0.1.0
;; Package-Requires: ((emacs "25.1"))
;; Keywords: internal dummy tests

;; This file is not part of GNU Emacs.

;; 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
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:
;;
;; Test for stand-alone analysis from CLI
;;

;;; Code:



(provide 'dummy-package)
;;; dummy-package.el ends here
15 changes: 15 additions & 0 deletions tests/fixtures/dummy-package/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash

cd $(dirname "$0")

# Test MELPA version
echo "Testing packaged version from MELPA..."
eask clean all
eask install elsa
eask exec elsa dummy-package.el

# Test development version
echo "Testing development version via eask link..."
eask clean all
eask link add elsa "../../../"
eask exec elsa dummy-package.el